WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Short Codes not working in Text widget (5 posts)

  1. brfine
    Member
    Posted 8 months 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
    Thanks

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

  2. Roy
    Member
    Posted 8 months 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
    Member
    Posted 8 months 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
    Member
    Posted 8 months 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. jameskoster
    Member
    Plugin Author

    Posted 8 months ago #

    Marking as resolved.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.