• Hi. Shortcodes in widget doesn’t work. I use text with inserted shortcode. I’m using 0.9.6 version.

    Help please πŸ™‚

Viewing 6 replies - 1 through 6 (of 6 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Add this to your themes functions.php:

    add_filter('widget_text', 'do_shortcode');

    Go to Appearance>Editor>functions.php and add that code at the bottom.

    Thread Starter brokoli

    (@brokoli)

    It worked. Thank you so much πŸ™‚

    Thread Starter brokoli

    (@brokoli)

    One more question. What if I want to add this shortcode to frontpage – just above the slider. I’ve tried adding this code into frontpage.php but it didn’t work:

    <div class="mmy">echo do_shortcode( '[shortcode]' );</div>

    Thread Starter brokoli

    (@brokoli)

    Nevermind, I got it. This is what I should have done:

    <div class="mmy"><?php echo do_shortcode('[shortcode]'); ?></div>

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Are you breaking in and out of php correctly?

    <div class="mmy"><?php echo do_shortcode( '[shortcode]' ); ?></div>

    Thread Starter brokoli

    (@brokoli)

    You beat me for 20 seconds, see my post above. It was a stupid rookie mistake πŸ™‚

    Thanks a lot for your help πŸ™‚

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Shortcodes in widget doesn't work’ is closed to new replies.