WordPress.org

Ready to get started?Download WordPress

Forums

dynamic menu highlighting including images (6 posts)

  1. Aale
    Member
    Posted 7 years ago #

    i finally got the dynamic menu highlighting working, and as it is often the case; now i want more. i want an image to be shown behind/above the menu-link when a page is visited in addition to just highlighting the menu-item via current_page_item. i hope someone has tried this before and has a solution for poor coding me :)

  2. Aale
    Member
    Posted 7 years ago #

    bump

  3. spencerp
    Member
    Posted 7 years ago #

    A URL to the blog in question might help a little bit? We can't see what you're working on, and working with..it's kind of hard to help without anything to look at, ya know..? =P

    spencerp

  4. Aale
    Member
    Posted 7 years ago #

    well, you're right. but i'm working on it via localhost, there is no internet-version yet. but i will paste the relevant code here; header.php:

    <div id="supernav">
    <ul id="pages">
    <?php
    $pg_li="page_item";
    if (is_home()) {$pg_li .=" current_page_item";}
    ?>
    <li class="<?php echo $pg_li; ?>"><a href="<?php bloginfo('siteurl'); ?>" title="Blog">Blog</a></li>
    <?php wp_list_pages('sort_column=menu_order&title_li='); ?>
    </ul>
    </div>

    style.css:
    #supernav .current_page_item a{
    color: #c40;
    }

    hope that helps a bit.

  5. Aale
    Member
    Posted 7 years ago #

    any ideas?

  6. Evita
    Member
    Posted 7 years ago #

    Maybe you try to give your current page class width, height and background-image:
    #supernav .current_page_item a{
    width:=xx; height=xx; background:transparent url(yourpic) top left no-repeat; color: #c40;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic