I have a Custom Taxonomy for WooCommerce Products. The Taxonomy is "Bait Brands"
The Bait Brands have a hierarchical structure.
I want to setup a sidebar hierarchical menu tree but I only want the tree subcategories to display if the current taxonomy page is one of those subcategories or is a parent of the subcategory. I also want some conditional statements that will trigger CSS/HTML so that the current archive and parent archive names are bold.
So let's say we have this setup created in the admin area....
BAND BRAND1
- Sub-Brand 1-1
- Sub-Brand 1-2
- Sub-Brand 1-3
- Sub-Brand 1-4
- Sub-Brand 1-5
BAND BRAND2
- Sub-Brand 2-1
- Sub-Brand 2-2
- Sub-Brand 2-3
- Sub-Brand 2-4
- Sub-Brand 2-5
BAND BRAND3
- Sub-Brand 3-1
- Sub-Brand 3-2
- Sub-Brand 3-3
On the public side, if the current page is NOT one of the archive pages , then I want it to simply display the Parent Terms
BAND BRAND1
BAND BRAND2
BAND BRAND3
Then when a visitor clicks on one of the parent terms it takes them to that terms archive page. Let's say they click on BAND BRAND2.
So then the tree that gets displayed on the site should be...
BAND BRAND1
<b>BAND BRAND2</b>
- Sub-Brand 2-1
- Sub-Brand 2-2
- Sub-Brand 2-3
- Sub-Brand 2-4
- Sub-Brand 2-5
BAND BRAND3
So 2 things happened here... since BAND BRAND2 is the current archive, it needs to be bold.. and also all of the subcategories of BAND BRAND2 should appear. I don't want any of the subcategories of BAND BRAND1 or BAND BRAND3 to appear because neither of those are clicked.
I have been able to accomplish this so far with a simple nested view.
However, the problem arises when we need to go deeper... and a visitor clicks on one of the subcategories. Let's assume they click on Sub-Brand 2-2. Then I want the tree to be displayed as....
BAND BRAND1
<b>BAND BRAND2</b>
- Sub-Brand 2-1
- <b>Sub-Brand 2-2</b>
- Sub-Brand 2-3
- Sub-Brand 2-4
- Sub-Brand 2-5
BAND BRAND3
So now we are on the "2nd Level" of the menu tree... and the current archive name (Sub-Brand 2-2) is bold... the parent category name (BAND BRAND2) is also bold.
I have not been able to figure out how to use the conditional statements properly to get this accomplished when someone clicks on one of the subcategories (2nd level ) links.
I have searched all through your support forum.
Please help.
I am trying to emulate this page.... hidden link