• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Exclude Categories From The WooCommerce Product Category Widget

Add this code to the end of your child themes functions.php file to exclude one of more product categories from displaying in the WooCoomerce Product Category widget.

Register for full access


The above code removes 2 categories.

Simply change the category i.d’s to suit your own needs.

WooCommerce

Reader Interactions

Comments

  1. Wendy says

    September 25, 2014 at 3:22 pm

    Hi Brad

    Found this through your answer on stackoverflow. Thanks for providing the snippet however I cannot get it to work. My category stays in the “woocommerce product categories widget”. I of course changed the category id. Could it be a change in Woo 2.2? I looked at the class-wc-widget-product-categories.php but couldn’t see any change. This file however is not in the new Woo 2.2 widget-product_categories.php

    Appreciate any help you can provide.

    Thanks
    Wendy

    Log in to Reply
  2. Fernando says

    June 5, 2014 at 5:02 pm

    Is possible to affect two sidebars? For example in sidebar 1 I have the widget and want to exclude 3 of 10 categories in sidebar 2 I have the same widget but I want to exclude only 1 category.

    Log in to Reply
    • Brad Dalton says

      June 5, 2014 at 5:10 pm

      You can modify the code to do that.

      Log in to Reply
      • Fernando says

        June 5, 2014 at 5:12 pm

        Do you have any example for that?

        Log in to Reply
        • Brad Dalton says

          June 5, 2014 at 5:15 pm

          The code would need to be written and tested.

          Log in to Reply
  3. Jason says

    May 19, 2014 at 9:00 pm

    Is there a way to do this for woocommerce shortcode? ie

    • Admin

      Admin (1)

    • Genesis

      Genesis (14)

    • WooCommerce

      WooCommerce (30)

    • WordPress

      WordPress (4)

    Log in to Reply
    • Brad Dalton says

      May 20, 2014 at 3:47 am

      You could add a argument to the code to do this.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags