[Resolved] Categories in Niche Theme

Home Forums Support Categories in Niche Theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1052632
    caleidoscopic

    Hi!

    I’m testing the “Niche” template from the site library.

    https://gpsites.co/niche/shop/

    Is it possible to show below “Shop” only the main category but not the subcategories?

    Thanks

    #1052648
    David
    Staff
    Customer Support

    Hi there,

    go to Appearance > Elements and edit the Woocommerce Shop Category Menu hook.
    At the top of the code you will see this:

    $cat_args = array(
    	'orderby'    => 'name',
    	'order'      => 'asc',
    	'hide_empty' => true,
    );

    You need to add a parent argument to that list so it looks like this:

    $cat_args = array(
    	'orderby'    => 'name',
    	'order'      => 'asc',
    	'hide_empty' => true,
    	'parent' => 0,
    );
    #1104249
    caleidoscopic

    And could the subcategories be displayed in a drop-down menu under the category?

    #1104262
    David
    Staff
    Customer Support

    Not using that method without custom development.
    You can try adding the Secondary Navigation in its place instead.
    Quick Edit the Hook Element containing the navigation and save it as draft.
    Then create another Hook Element with the same settings and add this for its content:

    <div class="second-nav grid-container">
    	<?php generate_secondary_navigation_position(); ?>	
    </div>

    Then you need to:
    1. Assign a Menu to your Secondary Navigation.
    2. In Customizer > Layout > Secondary Navigation set Location to No Navigation.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.