• I don’t know when this actually happened, but I only noticed it yesterday. I had shortcodes in several text widgets that stopped resolving so they actually displayed the shortcodes.

    I’ve been able to fix it by adding a do_shortcode filter in my functions.php file, but I wanted to report it in case others are having the same problem. Unfortunately, at first I thought it might be a plugin conflict so I deactivated all of mine, which caused me to lose a boatload of widgets that will take me quite a while to recreate, so I don’t want others to go through the same problem.

    Also, if it is an error in the core code and gets fixed, I don’t know if adding the filter myself will cause problems.

    This is the code I added to functions.php:

    add_filter('widget_text', 'do_shortcode');

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sounds like your attempting to use the do_shortcode filter outside of the WordPress loop, if so you will need to call your shortcode in the template files by using <?php echo do_shortcode('your-shortcode-here'); ?> in the section where you want the shortcode to appear.

    Thread Starter techforluddites

    (@techforluddites)

    Yes, it is outside the loop. But it was working fine for months so I’m not sure what changed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcodes in Text Widgets Broken’ is closed to new replies.