Archived topic
Categories in Niche Theme
3 replies · Started by caleidoscopic on November 4, 2019
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
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,
);
And could the subcategories be displayed in a drop-down menu under the category?
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.