- This topic has 5 replies, 2 voices, and was last updated 4 years, 4 months ago by
David.
-
AuthorPosts
-
January 9, 2019 at 7:45 pm #777859
Sean
Hi,
For my navigation link “Gallery” I have set it as a custom link so it scrolls down to the relevant section on home page.
However, the link is only working on the home page, if I browse on any other page, about or contact, the Gallery navigation link will not link back to gallery section on the homepage.
How do I rectify this?
January 10, 2019 at 5:58 am #778177David
StaffCustomer SupportHi there,
you would need to use the full url: eg. https://mywebsite.com/#link
January 10, 2019 at 11:11 pm #778872Sean
Great, thanks! The only problem now is on the home page hero section both the home and gallery link are underlined as active at the same time. How do I fix this? here is the css:
@media (min-width: 769px) { .main-navigation .menu > .menu-item > a::after { content: ""; position: absolute; right: 0; left: 50%; bottom: 15px; -webkit-transform: translateX(-50%); transform: translateX(-50%); display: block; width: 0; height: 2px; background-color: currentColor; transition: 0.3s width ease; } .main-navigation .menu > .menu-item.current-menu-item > a::after, .main-navigation .menu > .menu-item.current-menu-ancestor > a::after, .main-navigation .menu > .menu-item > a:hover::after { width: 50%; } }
January 11, 2019 at 4:08 am #779013David
StaffCustomer SupportSo as long as you don’t mind that the Gallery Link won’t show as the active link, as that is real tricky to do, then this:
1. Go to Appearance > Menus – edit the gallery menu item and give it a CSS Class ( make sure this option is active under the Screen Settings in the Menu editor). example class:
jump-link
:2. Edit this line of CSS:
.main-navigation .menu > .menu-item.current-menu-item > a::after, .main-navigation .menu > .menu-item.current-menu-ancestor > a::after, .main-navigation .menu > .menu-item > a:hover::after { width: 50%; }
So it looks like:
.main-navigation .menu > .menu-item:not(.jump-link).current-menu-item > a::after, .main-navigation .menu > .menu-item:not(.jump-link).current-menu-ancestor > a::after, .main-navigation .menu > .menu-item > a:hover::after { width: 50%; }
This will exclude that item from the current menu item effect.
January 11, 2019 at 5:50 pm #779619Sean
Great all working, thanks very much David!
January 11, 2019 at 6:44 pm #779639David
StaffCustomer Supportawesome. glad to be of help.
-
AuthorPosts
- You must be logged in to reply to this topic.