menus
-
Hi there! Is it possible to have two menus on my site? One for the homepage with three items, and two for all the others?
I know that I can create two menus, but I struggle to understand how to allocate them to two page categories. Home and Project page.
My coding skills are a bit rusty and limited.
Thank you!
-
you mean you have 2 menus.
but you want to show one only on the homepage.
and the other one on the other pages.add this in:
lay options -> custom css & html -> custom css for desktop/* hide first menu by default */ nav.primary{ display: none; } /* show first menu on home */ body.slug-home{ display: block; } /* hide second menu on home */ body.slug-home nav.second_menu{ display: none; }
i use the selector:
body.slug-homefor the homepage. this may be different for you!
slug-**where
** can be a different word for you.
when u edit your page, you can see the slug:
its basically your title of the page but with lowcaps and without spaces or special signs
-
if this doestn work i'd need your website address so i can check it out
-
Hey, thank you for this.
I don't seem to find the slug. The two menus are active and placed on top of each other, and the home page has an extra item, "Work", which is a custom link that scrolls further down to the beginning of the projects. The menu with two items should appear on all the other pages. I hope it makes sense! Thank you so much, Leonardo.
-
-
oh
`
/* hide first menu by default */ nav.primary{ display: none; } /* show first menu on home */ body.slug-home nav.primary{ display: block; } /* hide second menu on home */ body.slug-home nav.second_menu{ display: none; }
this css should work instead of the other one i posted
i made a mistake with the other css, something was missing -
Hello! It seems to me that at the moment you configured Lay Theme to only have one menu. Cause in the markup I can see that the first menu exists, but I don't see the second menu.
I think my code should work. If you want to, you can send your WP admin login info, and I'll just try to make it work in there.
can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?
-
ok so you wrote me an email that you made it work somehow. im glad it worked for you!
I also code custom websites or custom Lay features.
šæ Email me here: šæ
info@laytheme.com
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