Plugin Author
malihu
(@malihu)
Hello,
Your menu links get highlighted by the theme and another CSS selector in custom/additional CSS:
.main-navigation .menu > .current-menu-item > a::after
It’s normal for themes to highlight the current page menu items/links, as they indicate to the user the current page he/she is in. In your case, your theme’s CSS selector that does this is:
.main-navigation .main-nav ul li[class*="current-menu-"] > a
You are correct in guessing that in /portfolio/belocerkevska/ your links do not get highlighted because anchors are not present on page (i.e. are not indicating the current page).
The solution is to revert the CSS by adding the following to your custom/additional CSS:
.main-navigation .main-nav ul li[class*="current-menu-"] > a._mPS2id-h{
color: inherit;
}
.main-navigation .menu > .current-menu-item > a._mPS2id-h::after{
width: 0;
}
.main-navigation .main-nav ul li[class*="current-menu-"] > a._mPS2id-h:hover,
.main-navigation .main-nav ul li[class*="current-menu-"] > a._mPS2id-h.mPS2id-highlight{
color: #ff8700;
}
.main-navigation .menu > .current-menu-item > a._mPS2id-h:hover::after,
.main-navigation .menu > .current-menu-item > a._mPS2id-h.mPS2id-highlight::after{
width: 90%;
}
The above CSS will also highlight the menu links dynamically as you’re scrolling the page, via the .mPS2id-highlight class (if you don’t want this, simply remove from the above the 2nd selector that contain the .mPS2id-highlight class).
I’d also suggest to go into plugin settings and enable “Prevent other scripts from handling plugin’s links” option (in order to prevent your theme’s smooth scrolling function).
Let me know if this helps
Thanx a lot for quick help.
Now menu is working on homepage, but on single portfolio page there is only hover color, but no ::after line. Current additional CSS:
.main-navigation .main-nav ul li[class*="current-menu-"] > a._mPS2id-h{
color: inherit;
}
.main-navigation .menu > .current-menu-item > a._mPS2id-h::after {
content: "";
position: absolute;
left: 5%;
color: #ff8700;
bottom: 0px; /* controls where the line appears on hover */
-webkit-transform: translateX(0%);
transform: translateX(0%);
display: block;
width: 0;
height: 5px; /* controls thickness of the line */
background-color: currentColor;
transition: 0.3s width ease;
}
.main-navigation .main-nav ul li[class*="current-menu-"] > a._mPS2id-h:hover,
.main-navigation .main-nav ul li[class*="current-menu-"] > a._mPS2id-h.mPS2id-highlight{
color: #ff8700;
}
.main-navigation .menu > .current-menu-item > a._mPS2id-h:hover::after,
.main-navigation .menu > .current-menu-item > a._mPS2id-h.mPS2id-highlight::after{
width: 90%; /* controls the width of the line */
}
I think only need add some selector to width: 90% part, but really dont know which one 😉
Plugin Author
malihu
(@malihu)
Did you fix it? I can see the line when I hover your menu items on /portfolio/belocerkevska/. The CSS selector (for the 90% width) is already there:
.main-navigation .menu > .menu-item > a:hover::after
Yes I tryed something and it works. Thanks a lot for Your support.