WordPress.org

Ready to get started?Download WordPress

Forums

Two State CSS Button Show Active State (5 posts)

  1. flashbuddy
    Member
    Posted 2 years ago #

    http://districtagency.cmsdabbler.com/who-we-are/

    Counseling and advice sought on how to get my buttons to highlight when on the particular page.

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    without a 'current' state in the code, this is possibly very difficult;

    can you pastebin the full code of your menu?

    are you planning to make a 'current' state of the menu image?

  3. flashbuddy
    Member
    Posted 2 years ago #

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    you possibly need to use a conditional tag for each button;

    example:

    <div id="homeBtn"><a href="<?php bloginfo('url');?>/" title="District Agency Home Page" <?php if( is_home() ) echo 'class="current"'; ?>><img src="<?php bloginfo('template_directory');?>/images/homeBtn-norm.png" alt="Home Button" /></a></div>

    analog for the other menu tabs, with is_page('what-we-do')
    or with is_category('case-study') and so on...

    http://codex.wordpress.org/Conditional_Tags

    and add corresponding styles to style.css;

    example (to make the .current look like the hover):
    #who-we-are_btn-2-state_button li a.current { background-position: left -39px; }
    and optional hover state:
    #who-we-are_btn-2-state_button li a.current:hover { background-position: left -0px; }

  5. flashbuddy
    Member
    Posted 2 years ago #

    Giving this a try now...

Topic Closed

This topic has been closed to new replies.

About this Topic