WordPress.org

Forums

Using background images with dynamic menu highlighting (5 posts)

  1. ianbarker
    Member
    Posted 8 years ago #

    I have created a menu using background images within a list instead of using text. I have an unvisited state, a hover state, and a state to indicate that you are on that menu choice's page.

    In a normal web page, I can change the state on each page to indicate the page the visitor is on by using in-line CSS. But with WP, I have to use dynamic menu's to call the page. I've tried doing this but the only method I can find is with a text menu. But I am using images that have to be called individually.

    I understand from the tutorial that I need to insert an internal CSS into header.php to change the menu state of the current page. It gives this code:


    <style type="text/css">
    #<?php echo $current; ?> {
    background-color: yellow;
    }
    </style>

    But I need to specify a different current state depending on the page (Home, About Us, Support, Resources). How do I do this? How do I give a different CSS command depending upon the current page?

    You might be able to understand what I'm saying if you go to my website (www.ianandjocelyn.com/)

  2. ianbarker
    Member
    Posted 8 years ago #

    Does this make sense to anybody?

  3. moshu
    Member
    Posted 8 years ago #

    It does... but the bumping after 4 hours doesn't.
    And for future reference - read this.

  4. ianbarker
    Member
    Posted 8 years ago #

    Understood. Thanks.

  5. webjefa
    Member
    Posted 7 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic