How to use shortcodes in your WordPress theme template files

Sometimes, while developing or customizing a WordPress theme or template files, it can be very useful to be able to execute a shortcode inside a template page instead of only within your WordPress Post or Page content. Just add this code below anywhere in your theme’s template pages to execute your shortcode using the do_shortcode() WordPress function:

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

Just replace your_shortcode with the name of the shortcode you want to execute.

Hope this helps, enjoy.

   Related Sponsored Links

Disclaimer: The information contained in this website is for general information purposes only and in no event will this site or its owners be liable for any losses or damages associated with your use of our site or content. Click here to see our full Disclaimer.


  1. vijaykudal says:

    I am using plugin like to read problem is its using opening and closing shortcodes,when I embed them to my site only opening short codes displayed,can you please help me?
    PS:-tried with different themes as well

Leave a Comment