WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Marking the current page in navigation (5 posts)

  1. theodorlindekaer
    Member
    Posted 11 months ago #

    Hello,

    Would you guys mind sharing your opinions on how to highlight the current selected page in the navigation bar.

    Fx when the user is on the page "Product" I would like "Product" to take another color.

    Thank you

  2. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    depends on your theme, and on which WordPress function is used to make the navigation; most of those functions output a 'current-...' css class;

    for example: http://codex.wordpress.org/Function_Reference/wp_nav_menu#Menu_Item_CSS_Classes

  3. theodorlindekaer
    Member
    Posted 11 months ago #

    My theme is using:

    <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

    I am having a hard time understanding how it works and therefore how to highlight the selected page.

    Thank you for the link!

  4. alchymyth
    The Sweeper & Moderator
    Posted 11 months ago #

    try for isntance:

    .current-menu-item a { color: red; }

    your theme might use some more specific formatting;

    what theme are you using?

    can you post a live link to the site?

  5. theodorlindekaer
    Member
    Posted 11 months ago #

    I see. When looking at the source code, I do see the current tabs having a "current class". That is an easy way to solve my problem. Thank you!

    I am building my own theme on "Underscores".

Reply

You must log in to post.

About this Topic