Show third menu only on front page
-
Hi @arminunruh,
I'm looking for a way to have my third menu item (next to the title) only visible on my front page. I tried some of the custom css I found here on the topic, but was not able to do it. Any hint would be highly appreciated :). My website:
https://www.ricardowiesinger.deBest
Ricardo -
.third_menu{
display: none;
}body.slug-home .third_menu{
display: block;
} -
@arminunruh Thank you! Unfortunately the third menu still appears on all pages.
-
.third_menu{
display: none!important;
}body.slug-home .third_menu{
display: block!important;
}this should work :)
-
@arminunruh Works perfectly now, thank you!!
-
Hello! A short follow up on this one.
I'd like my second menu to be on front page AND on the about page too, and to not appear on the rest of pages. My second menu is my language menu operating with polylang atm. The solution above works like a charm without Polylang, but when I added the plugin the second menu disappeared on all pages. How can I make my second menu appear on front page, about page, keeping polylang? -
do you have a link?
-
@arminunruh this is the link. [https://devoorkamer.org/](link url)
Although Im working on the most recent version of the site on my local host. On the link the Polylang is not installed yet and the main menu doesnt have all the pages. Attaching a screenshot with the most recent version with annotations for reference. -
interesting!
maybe you can manage to code this!
you just need to find out the body classes you need:
https://laytheme.com/documentation/custom-css-styling.html#css-based-on-current-pagelook at this example
this has the class slug-imagehover-test
so i use the css body.slug-imagehover-test
try to learn how to use the chrome inspector. i inspect the html and i see the <nav has the class primary
so i do:
body.slug-imagehover-test nav.primary{ display: none!important; }
to hide that menu on that page
this way you can hide or show menus depending on which page you are on
good luck
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it