Home <- index.php
Home/Products/ <- a page with custom page template, use get_terms('class')
to list all value in Class
Home/Products/Class <- taxonomy-class.php , list products in this class
Home/Products/Class/Product-Post <- single-products.php , the product detail
And I setup a nag-menu like this :
-Home
-Products
--Crab ( class - custom taxonomy )
--Shrimp ( class - custom taxonomy )
-about
-contact
1. When I’m in Products page, WP will add a .current-menu-item
to Products tab.
2. When I’m in Crab page, WP will add a .current-menu-item
to Crab and add .current-menu-parent
to Products.
Here is what I want :
When I’m in Snow-Crab (belongs to Crab) , I want to add .current-post-parent
to Crab , and .current-post-ancestor
to Products on nev-menu , so I can style with CSS to highlight it.
Is there any way to do it ?
It can be done like normal category and post relationship , just use post type archive page to Products page in nev-menu , but the problem is I use the way in this topic to make permalink in right structure , which makes my post type archive permalink became products/%class%
, can’t be interpreted correctly in nav-menu and even can do it , WP will still not add .current-post-parent
to Crab tab (sub-menu to Praducts) in nav-menu.
Anyone has idea ?
Thanks you.
]]>https://cooksjourney.com/travelogue/.
Help?
]]>Thanks
]]>I want to modificate my my default nav menu with one that I’ve created in WordPress Menu Manager (nav-menu.php).
My template is Traction. How can I remplace the default with the new ?
I’ve add this code in funcion.php :
<?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>
And how to activate it now im my template ?
My website : www.webkef.com/en
]]>