• Hi,

    I cannot get shortcodes to work in text widgets to save my life. I heard that this is enabled by default in the latest wordpress, however it will not work. I also tried adding add_filter(‘widget_text’, ‘do_shortcode’); to my functions.php file for the theme, but the shortcode still shows up as a string. Was this feature broke in the newest version of wordpress?

Viewing 4 replies - 16 through 19 (of 19 total)
  • No way! I can’t just stick things in brackets to [make-it-magically-work]!?

    I haven’t tried those exactly but I did try five or six off of the WordPress shortcode list: https://en.support.wordpress.com/shortcodes/. The one I’d assume would work was [archives] because even the WordPress support page says that it should work in a text widget (https://en.support.wordpress.com/archives-shortcode/). I’ve tried it with specific plugin shortcodes as well (i.e. soliloquy and tubepress).

    Thought that one of the plugins might of been effecting it but I’ve deactivated all of them and still no luck.

    off of the WordPress shortcode list

    you are quoting from WordPress.com – this list does not exist in WordPress.org

    [gallery] and [caption] are the only genuine WordPress.org shortcodes.

    so what legitimate shortcodes have you tried?

    ps:

    No way! I can’t just stick things in brackets to [make-it-magically-work]!?

    you will be surprised what some users are trying ??

    this was a serious remark as some ‘square bracket codes’ from plugins are no shortcodes, and still some people try to use the ‘do_shortcode()’ function on it.

    I was able to get [caption] working, or at least I didn’t see the shortcode. Still, not sure why the other shortcodes do not work. Will only [caption] and [gallery] work in the text-widget?

    In either case I found a work-around for my larger issue, thanks for the help.

    any shortcode which is based on a function or a plugin, or came as part of your theme, should work in a textwidget (provided you have add_filter('widget_text', 'do_shortcode'); in functions.php of your theme).

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Shortcode in widgets not working’ is closed to new replies.