1. Home
  2. Knowledge Base
  3. Widgets and Plugin
  4. Advanced Widgets
  5. Widget Shortcodes in WordPress Theme/Template files

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