[resolved] Short Codes not working in Text widget (5 posts)

  1. brfine
    Posted 2 years ago #

    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


  2. Roy Ho
    Posted 2 years ago #

    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' );
  3. brfine
    Posted 2 years ago #

    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.

  4. brfine
    Posted 2 years ago #

    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.

  5. James Koster
    Plugin Author

    Posted 2 years ago #

    Marking as resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.