Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #11285

    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

    #71255

    I solved it for a custom menu widget but not for the flashlight menu. Any idea?

    Thanks

    #71256

    Still not found. Is this not possible?

    #71257

    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

    #71258

    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

    #71259

    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;

    if(strpos($link, $item->url) !== false)

    {

    $classes[] = ‘current-menu-item';

    }

    return $classes;

    }

    Then you can use the current class.

    Thanks

    #71260

    Glad you figured it out. Thanks for posting the solution here.

    Regards,

    Mya

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘current page link color’ is closed to new replies.