WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. iversoncru
    Member
    Posted 1 year ago #

    Hi there!

    I have been trying to keep the border-bottom in each menu item when i am in the current page, here:
    http://iversoncru.eshost.es/

    and i dont know how to do it..

    would anyone give me some light?

    thanks in advance :)

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year 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;

    http://codex.wordpress.org/Function_Reference/wp_nav_menu

    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>

    http://codex.wordpress.org/Conditional_Tags

  3. iversoncru
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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