If you’re selling from your WordPress site using Woocommerce, you might want to add an additional nav menu which only displays on WooCommerce related pages.
This code, enables you to:
- Control which WooCommerce pages the menu displays on.
- Determine which location on the page you want the menu positioned using genesis hooks.
- Exclude or include specific pages.
Simply add the following PHP code to the end of your child themes functions file using a code editor:
WWHaT says
How could I Remove(hide) Primary and secondary Navigation Menu From menu Page? I just want to show woo commerce menu at the top menu . Any chance you can help?
Brad Dalton says
The following code assumes your menus are hooked using the genesis_after_header hook and removes both menus from the front end.
Or are you referring to removing the menus from Appearance > Menus on the admin page?
WWHaT says
Hi,Brad I’m sorry that the way I narrate is unclear. My problem is Remove(hide) Primary and secondary Navigation Menu , When I am in the WooCommerce Pages , and just show woo commerce menu. Not in my all web sites.
Brad Dalton says
You can use the code below to do that with conditional tags for woocommerce
WWHaT says
sorry, I have another problem is that I want to add second Custom Menu To Specific WooCommerce Pages Only.
It’s mean that I will have two Custom Menu to WooCommerce Pages Only.
Brad Dalton says
Sure, i have code for this. Did you search?
WWHaT says
Yes, I did. I try to do from this ” Adding Additional Nav Menu’s in Genesis” , but it’s not show on WooCommerce Pages Only.
sorry, I’m a little fool.
jmelee1221 says
Actually I figured it out. I am so dumb. I didn’t see the WooCommerce Menu drop down in the menus. Sorry about that!
jmelee1221 says
Actually it isn’t working. 🙁
Brad Dalton says
Here’s the code you can add to your functions file
jmelee1221 says
I used the code above and it’s not working. I changed the info to match what I wanted, but on the product pages, and shop page its not work for my header_left menu. Any chance you can help?
Thanks in advance..
Brad Dalton says
Please email me a copy of your theme which includes the code and i’ll fix it for you.
What theme are you using and what do you mean by header_left menu?
jmelee1221 says
I am using a child theme from Hello You Designs called Hello Glam.
Currently I am on a test site, so if it makes it easier I can give you access to login and check it?
Brad Dalton says
OK. Please email me FTP hostname, username and password. brad@wpsites.net