WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » [Resolved] Short Codes not working in Text widget

[Resolved] Short Codes not working in Text widget

  • I had added the short code — [product_categories number=”5″ columns=”4″] — to the Text widget in the side bar and it worked. Then it stopped working and displays nothing.
    I tried some of the other short codes in a blank page. The ones that call a page (‘cart’, ‘my account’) work just fine. The others, like the one above, do not work and I can’t figure out why. I’ve tried different templates with the same result.
    Then I remembered I had upgraded WP from 3.5.1 to 3.6. Has anyone run into an issue like this before?
    WC 2.0.13 – WP 3.6
    Thanks

    http://wordpress.org/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Roy Ho

    @splashingpixelscom

    From what I remember in the past, shortcodes do not work in widgets without adding a filter in your theme’s functions.php.

    Not sure if 2013 theme includes it or not but I doubt it.

    The code you’re looking to add is:

    add_filter( 'widget_text', 'do_shortcode' );

    I have that in functions.php of the child theme. Also cleared the cache, just in case.
    Doesn’t make a difference. Still doesn’t work.

    Just to try something I created a new instance of WP 3.5.1, added WC 2.0.13 and some cats and products.
    The short code above worked in both a blank page and the Text widget in the sidebar. In both WP 3.5.1 and 3.6.
    So the problem appears to be in my Proffet theme.

    Plugin Author James Koster

    @jameskoster

    Marking as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Short Codes not working in Text widget’ is closed to new replies.
Skip to toolbar