WordPress.org

Ready to get started?Download WordPress

Forums

Theron Lite
[resolved] Current page (11 posts)

  1. yuncreativelabs
    Member
    Posted 1 year ago #

    Hello!
    I'm having troubles highlighting the current page I am in. I tried using the wp tag, like "li.current_page_item a" but it's not working...

    This is how the menu gets called:

    <div id="menu_wrap"><div class="center"><div id="topmenu"><?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?></div></div></div>

    Thanks in advance!
    Giulia

  2. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Use a Browser Inspector Tool to explore what class is applying to your list. Alternatively view your webpage's source and search there.

  3. yuncreativelabs
    Member
    Posted 1 year ago #

    <div id="menu_wrap">
    <div class="center">
    <div id="topmenu">
    <div class="menu-header">
    <ul id="menu-menu1" class="menu">
    <li id="menu-item-26" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-26">
    <a href="#">home</a></li>
    <li id="menu-item-33" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-33"><a href="#">Gallery</a>

    then following the other elements...

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Without seeing the site, almost impossible to help with things like this -- as CSS is totally site-specific and may be affected by other CSS code on a page.

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    is that the html of the menu when you are on the home page or gallery page?

    is there any 'current-menu-item' or similar in any of the 'following other elements'?

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

  6. yuncreativelabs
    Member
    Posted 1 year ago #

    sorry the code I posted wasn't helpful at all.

    I am on the "about" page, which is exactly as "gallery"..
    the line you are talking about (the one with the "current") is this:

    <li id="menu-item-40" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-38 current_page_item menu-item-40">
    <a href="#">About</a>
    </li>

    I know it says "current-menu-item" but I can't get it to work in the css... :(

  7. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Perhaps you're not using specific enough selectors.

  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Current menu item likely shows up in every menu item? If you want to target a specific page, you need to use a unique class or id for that page -- perhaps id="menu-item-40" ?

  9. yuncreativelabs
    Member
    Posted 1 year ago #

    oh god...I think I might need a little help on this.
    it's just not fair that when it is about me things are always this complicated...gah!

    I'll give it ago as soon as I have a little more time...thank you very much for your help guys!
    if you hear from me again here it means I have failed :/

  10. yuncreativelabs
    Member
    Posted 1 year ago #

    Hi again...
    I tried it all but couldn't get it to work.
    If someone would give some of his time to figure it out I'd be very grateful.
    This is the link pointing to one of the pages: http://www.yuncreativelabs.com/wp/gallery/

    Thanks a lot :(

  11. yuncreativelabs
    Member
    Posted 1 year ago #

    Just writing to let you know that I won.
    thanks everybody for your help though!!!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic