• Only parent categories are displayed on the main page of the store. How do I get all the final, final, without parental output?
    I tried adding it with a shortcode – it works. But in this case, the parent categories are still displayed at the end of the page. How to hide them completely?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey @ilyapokrov,

    I’m unable to access the page above, however, I’d like to understand which shortcodes have you used and how are they displaying.

    Warm regards,

    Thread Starter ilyapokrov

    (@ilyapokrov)

    @robertghetau,
    I removed the standard output of categories with code like this:

    add_action( 'pre_get_posts', 'bbloomer_remove_products_from_shop_page' );
     
    function bbloomer_remove_products_from_shop_page( $q ) {
       if ( ! $q->is_main_query() ) return;
       if ( ! $q->is_post_type_archive() ) return;
       if ( ! is_admin() && is_shop() ) {
          $q->set( 'post__in', array(0) );
       }
       remove_action( 'pre_get_posts', 'bbloomer_remove_products_from_shop_page' );
    }

    I have displayed the categories I want using this shortcode:
    [product_categories parent="90" columns="1000"]
    But in this case the caption is displayed “No products were found matching your request.”, which I hid with dislpay: none.

    I coped with the task, but I think that this is not a completely correct solution.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide standard output of categories’ is closed to new replies.