Answer the question
In order to leave comments, you need to log in
How to display subcategories in the sidebar on the product page?
There is a page for more than 6 categories, let's say I went to accessories, and the sidebar with subcategories of accessories is displayed on the page, tell me where to read
Answer the question
In order to leave comments, you need to log in
We make it a widget , as expected. Internally check the current page for is_category() . If yes, then we start to wool where we are (current category id):
$category = get_queried_object();
echo $category->term_id;
I solved the problem differently, installed the visual composer plugin, did not display subcategories in the sitebar, displayed them on the page of each category suits me.
If someone wants to display in the sitebar, then I think that you can create a page, display categories or subcategories on it through the visual composer, all the pages that you have created are like categories, make a menu out of it and add it to the sitebar as usual through an arbitrary menu. In general, as I can explain, if that guys write who will have such a task, I will explain if something is not clear.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question