How to use WordPress shortcodes in themes-/templates

How to use WordPress shortcodes in themes-/templates

This snippet will allow you to insert WordPress shortcodes into your theme-/templates – using WordPress built-in function do_shortcode()

Instructions
Add this code your theme files where you want the shortcode content to be run.

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

WordPress Snippet Info

Tested with Wordpress v. 4.9.5
Last Modified: 21.05.2017
Last Reviewed: 21.05.2017

How to use WordPress shortcodes in themes-/templates
4.4 (87.88%) 33 vote[s]
Please report broken snippets.
Report Broken Snippet
WordPress Hosting - WP Engine