Support » Plugin: Breadcrumb NavXT » Remove Shop from specific category

  • Debora1976



    I have hidden a category from the shop page like this:
    add_action( ‘woocommerce_product_query’, ‘prefix_custom_pre_get_posts_query’ );
    function prefix_custom_pre_get_posts_query( $q ) {
    if( is_shop() || is_page(‘awards’) ) { // set conditions here
    $tax_query = (array) $q->get( ‘tax_query’ );
    $tax_query[] = array(
    ‘taxonomy’ => ‘product_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => array( ‘relatiegeschenken’ ),
    ‘operator’ => ‘NOT IN’
    $q->set( ‘tax_query’, $tax_query );

    And added a link to the categorypage in my Menu.

    But when I click on that page, or on one of the products in that category, the Shoppage link also appears in the breadcrumbs of course.

    How can I hide the Shoppage link from the breadcrumbs if the catgeory is Relatiegeschenken?

    Kind regards,

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Remove Shop from specific category’ is closed to new replies.