< Back to blog

Code Snippet: How to add a WordPress shortcode to a template file

You can add WordPress shortcodes directly to template files using PHP.

Simply add the code snippet wherever you wish to display the shortcode’s content.

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

Code not working? Let me know below.

Popular