How to add a WordPress shortcode to a template file

You can add WordPress shortcodes directly to WordPress theme template files using a small PHP code snippet.

Simply add the following code snippet directly to any WordPress template file where you wish to display the shortcode content.

Replace [shortcode] with your own shortcode.

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

Code not working? Contact us to let us know.