Shortcodes in widgets?

Community Forums Forums Design Tips and Tricks Shortcodes in widgets?

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 1 year, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #41545

    edselby
    Participant
    Post count: 1

    I must be missing something —

    Why won’t shortcodes work in widget areas?

    For instance, in Home Top I’m trying to do 3 colums, but

    <pri>

    [one_third_first]<h2>Why</h2>[/one_third_first]
    [one_third]<h2>What </h2>[/one_third]
    [one_third]<h2> Partnters</h2>[/one_third]

    </pre>

    doesn’t work – it comes out exactly like you see it above, except the h2 tags are huge

    http://bizwire.edselby.com/
    #41546

    braddalton
    Participant
    Post count: 10577

    You need to firstly add support for shortcodes in widgets.

    Add this code at the end of your child themes functions.php file:
    [php]
    add_filter( ‘widget_text’, ‘shortcode_unautop’);
    add_filter( ‘widget_text’, ‘do_shortcode’);
    [/php]

    Source: http://steves-sandbox.com/blog/2012/04/17/genesis-enable-shortcodes-in-widgets/


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.