Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16015

    Hi – Thanks again for this great theme and for being so responsive on this forum. I was hoping you could help me figure out how to make your shortcodes work in the text widget? I’ve tried adding:

    add_filter(‘widget_text’, ‘do_shortcode’);

    to your functions.php page in the editor without any luck. I thought perhaps it mattered where I inserted it, but I’ve tried every area of that page without any luck. I’m sure it’s a silly thing I’m missing, but would you mind helping me out? I appreciate it.

    Best,

    Erin

    #89816

    Hi Erin,

    Short Codes won’t work inside a Text Widget. Try to use this plugin: http://wordpress.org/extend/plugins/wp-php-widget/ and put your do_shortcode command there. This is an example of how to use it:

    <?php echo do_shortcode('[gallery]'); ?>

    Just replace the gallery shortcode with the shortcode you want to use. Hope this helps. :)

    Regards,

    Ismael

    #89817

    Hi Ismael – Thanks for the quick response. I did try that plugin, but without success. The php goes away when you preview the page, but the shortcode remains. I’ll keep looking around to see if there’s any other options.

    Best,

    Erin

    #89818

    Hi Ismael – I wanted to post for other people who may be looking for the same answer I was about shortcode and widgets.

    The advice you gave me worked beautifully. I made a ridiculous mistake the first time I tried that plugin and code which is why I didn’t think it worked. Yikes. :)

    Thanks again. You guys rock!

    Best,

    Erin

    #89819

    Hey,

    Good thing it worked. Glad to help. :)

    Regards,

    Ismael

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

The topic ‘Short code in text widget’ is closed to new replies.