fbpx
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.3 (86.86%) 35 vote[s]
Please report broken snippets.
Report Broken Snippet

Recent Comments