Warning: Cannot modify header information - headers already sent by (output started at /home/shanem2/public_html/index.php:3) in /home/shanem2/public_html/wp-content/plugins/index/index.php on line 54
Using Wordpress Shortcodes in Themes Files - Shane Hale
 

Using WordPress Shortcodes in Themes Files

May 20th, 2013 | Wordpress | | Comments

When building a themes for WordPress you may want to leverage WordPress Shortcodes in areas other than you content zones. Often I found myself saying, it would be great to have this plug in appear in the footer, modal box or right rail. Many plug-ins offer PHP codes for implementation but for those that don’t you can utilize this little snippet of code.

WordPress Shortcode Function

<?php echo do_shortcode("[shortcode]"); ?>

Simply replace the [shortcode] with which ever plugin of functional short code you choose. For example you could have:

<?php echo do_shortcode("[slideshow]"); ?>

This WordPress shortcode function should provide you with additional flexibility without having to dig or write new alternative php code.

Shane Hale User Experience & Conversion

Comments: