Widget Shortcodes in WordPress Theme/Template files

WordPress will not automatically convert shortcodes that are placed directly in template files.

However, you can take advantage of the do_shortcode(); function to get around this limitation.

e.g. instead of this shortcode

[mbb_widget id="MBBv3_SearchForm"]

use this PHP code
<?php echo do_shortcode('[mbb_widget id="MBBv3_SearchForm"]'); ?>

Updated on February 26, 2022

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support