• Resolved aale

    (@aale)


    Hullo!

    I’m quite new to css and theme-designing within wordpress and i encountered (unexpectedly;) ) a problem. i want my page to highlight menu-items not only by “hovering” but also to highlight the menu-item that’s currently viewed (including the “home”-page). i checked, of course, the codex, but that seems some kind of outdated. i searched these forums, but the bunch of solutions offered lacked a clear desciption regarding my problem and i wasn’t able to tie the strings together 🙁
    i use a horizontal menu with the following links within the header.php

    <div id="supernav">
    <ul>
    <li><a href="index.php" title="Blog">Blog</a></li>
    <li><a href="index.php?page_id=6" title="Projekt">Projekt</a></li>
    </ul>
    </div>

    the “active” part of the style.css:

    #supernav a:active {
    color: #c40;
    text-decoration: none;
    font-weight: bold;
    }

    how can i bring them together? i wasn’t able to do it with current_page_item and if pageid etc, so i’m asking you knowing fellows 🙂
    thank you for sharing your knowledge!

Viewing 4 replies - 1 through 4 (of 4 total)
  • i wasn’t able to do it with current_page_item

    Why?

    Thread Starter aale

    (@aale)

    well, i tried to built it into the style.css just pasting the following code (from:http://www.gudstoff.com/dynamic_menu.htm):

    .page_item {
    background-color:#ccc;
    color:#000;
    }
    .current_page_item {
    background-color:#000;
    color:#fff;
    }

    Nothing happened. that’s all. need i do more?

    Well, you need to use the wp_list_pages template tag for displaying your Pages. That’s the one that generates the “current_page_item” thing…

    Thread Starter aale

    (@aale)

    the pages display, that’s alright. but when i add wp_list_pages code to my header.php in which my supernav-menu is located, i get a second menu excluding the “home”-page. can i somehow mix the wp_list_pages ttag with my supernav in the way that my “supernav” is affected (including the “home”-page) and no extra-menu created? the codex doesn’t offer help for me :/

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘dynamic menu highlighting – again!’ is closed to new replies.