Forums

WooCommerce - excelling eCommerce
[resolved] Remove Certain Product Category from Shop/Home (5 posts)

  1. miketopher
    Member
    Posted 11 months ago #

    Can anyone tell me how to remove a product category from the shop/shop home page in WooCommerce

    Iv already tried
    https://gist.github.com/1705012

    and it worked, but since the latest wp and woo updates this no longer works.

    I also wrapped in the if is_admin thing, again it worked, but not since update

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

  2. mikejolley
    Member
    Plugin Author

    Posted 11 months ago #

    Try tweaking the hook

    add_filter( 'pre_get_posts', 'custom_parse_query', 20 );
    
    function custom_parse_query( $q ) {
    
    if ( $q->is_main_query() ) {
    
    // Query here
    
    }
    
    }
  3. miketopher
    Member
    Posted 11 months ago #

    i replaces what you provided, it broke :(

    i played around with it myself changing the is_ statement around but to no avail.. what ever it needs to be changed to im not good enough to figure it out

  4. mikejolley
    Member
    Plugin Author

    Posted 11 months ago #

    My mistake, add_filter should be add_action

  5. miketopher
    Member
    Posted 11 months ago #

    i still get
    Parse error: syntax error, unexpected $end in /home/site/domains/site.com/wp-content/themes/eyetheme/functions.php on line 71

Reply

You must log in to post.

About this Plugin

About this Topic