Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to display a specific gallery (without a plugin = WordPress built-in gallery) inside a widget. I tried the shortcode [gallery ids="717"] but that doesn't work. Maybe a workaround could be enabling shortcodes inside widgets? if yes, how do I do that?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Widgets don't usually allow shortcodes in them (they treat them as normal text).

What you have to do, is to tell this widget, it should run do_shortcode on it's text. To do it, you can use this snippet:

add_filter('widget_text', 'do_shortcode');

Just place it in your function.php file. Then you can place shortcodes in Text Widget and they will work normally.

share|improve this answer
    
nice! thanks for the quick answer –  jan reimers Jul 1 '13 at 9:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.