WordPress Shortcode with attribute Examples of Shortcodes


WordPress shortcodes were introduced in 2.5

Here is come example of shortcode


to use shortcode direct into theme you have to use do_shortcode()

 <?php echo do_shortcode('[button]'); ?>

To customize the button, we could simply add something like:

[button type="twitter"]

Or to make it even better, we could use an enclosing shortcode:

[button type="twitter"]Follow me on Twitter![/button]