Hello all,
How can I set the current page color? I have a hover color but when I click on a link that navigate me to a page I would like to see the same color as the hover so you can see wich page is active.
Thanks,
Martijn
Hello all,
How can I set the current page color? I have a hover color but when I click on a link that navigate me to a page I would like to see the same color as the hover so you can see wich page is active.
Thanks,
Martijn
I solved it for a custom menu widget but not for the flashlight menu. Any idea?
Thanks
Still not found. Is this not possible?
Hi Martijn,
Add this to your custom.css or your Quick CSS under Flashlight > Styling.
.main_menu .menu .current-menu-item a strong,
.main_menu .menu .current_page_ancestor a strong {
color: #1994E6;
}
You'll want to change the color to match to your hover color.
Regards,
Mya
Hello Mya,
That didn't work. The problem is that I made custom links so you can navigate immediately to single product pages. If I add a page menu item I see indeed the current page class. But the custom links don't have such class. Is there a way to change this or is there another way to get the result?
Thanks a lot.
Martijn
I found a solution. Add this code to your functions.php:
add_filter('nav_menu_css_class', 'AddCurrentMenuItemClass',1,2);
function AddCurrentMenuItemClass($classes,$item)
{
$link = site_url().$_SERVER['REQUEST_URI'];
if(strpos($link, $item->url) !== false)
{
$classes[] = 'current-menu-item';
}
return $classes;
}
Then you can use the current class.
Thanks
Glad you figured it out. Thanks for posting the solution here.
Regards,
Mya
This topic has been closed to new replies.