[resolved] keep border-bottom when current page (4 posts)

  1. iversoncru
    Posted 3 years ago #

    Hi there!

    I have been trying to keep the border-bottom in each menu item when i am in the current page, here:

    and i dont know how to do it..

    would anyone give me some light?

    thanks in advance :)

  2. Michael
    Forum Moderator
    Posted 3 years ago #

    for instance, build your menu with the WordPress function wp_nav_menu() which would automatically add a .current-menu-item css class to the current page link;


    otherwise you end up with a lot of conditional statements like:

    <li<?php if( is_page('about-us) ) echo ' class="current-page"'; ?>><a href="about-us/">About Us</a></li>


  3. iversoncru
    Posted 3 years ago #

    Thanks alchymyth, i take your advice, i'm going to change my menu to use WP function wp_nav_menu() and see what happens,
    i will be back to show the solution, if i find it

  4. iversoncru
    Posted 3 years ago #

    it worked perfectly!

    although i still wonder how i could manage to do it if i dont use wp_nav_menu...

Topic Closed

This topic has been closed to new replies.

About this Topic