• staggerlee

    (@staggerlee)


    Currently when the HOME [ get_option(‘home’) or bloginfo(‘url’)], page is ‘active’ the background color (#5c75aa) REMAINS illuminated.

    This is not true for other Header Menu items [ <?php $pages = wp_list_pages()]. None of the active <?php $pages = wp_list_pages() pages keeps background color when it or its children are ‘active’.

    I WANT THEM ALL TO BEHAVE THE SAME as HOME. (Meaning that the Active Menu item Background Color is Displayed on top Header Menu for Pages and CHILDREN; top level).

    Current Header.php

    <!– start header –>

    <div class=”header”>

    <div id=”header-TXT”>
    <h1>/”><?php bloginfo(‘name’); ?></h1>
    </div>

    <div class=”TB”>

    <? unset($pages); ?>
    </div>

    Current StyleSheet.php

    /* header */
    /**/ * html .header { height: 80px; } /* */
    .header { width:950px; height: 2.7em; background:#3b5998; border-bottom:6px solid #95a7ce; clear: left; padding: 0 0px 0 30px; margin:0 0 1.2em 0; }
    .header #header-TXT { float:left; padding: 0 0px .3em 0px; margin: .5em 0 .5em 0px; }
    .header h1 { font:bold 19px Arial, Georgia; letter-spacing: normal; padding: 0px; margin: 0px; font-weight: bold; }
    .header h1 a { color:#fff; text-decoration: none; }
    .header h1 a:hover { color:#f5f5f5; text-decoration: none; }
    .header-desc { display:block; border:1px solid #e2eaf5; color:#000; font-size: 14px; line-height: 15px; font:normal 8pt Tahoma; padding: 1em; margin: 1em 3em 1em 3em;}

    /* TB a toolbox */
    .TB { padding: 0 0px 0 2em; float: left; width: 35em; }
    .TB em { display: none; }
    .TB ul { list-style: none; margin: 0px; padding: 0px;}
    .TB ul li ul { display: none;}
    .TB li { padding: 0px; margin: 0px; display: inline; font-size: 10px; line-height: 11px; font-weight: bold;}
    .TB a { font: bold 1.1em Tahoma; padding: .5em 0px .4em 3px; margin-right: 2px; float: left;}
    .TB a span { padding: 4px 9px 5px 6px; display: block; float: right; }
    .TB a span { float: none; color: #fff;}
    .TB a:hover span { color: #fff;}
    .TB a:hover { background: #5c75aa; color:#fff; text-decoration: none;}
    .TB a:hover span { background: #5c75aa; color:#fff;}
    .TB .active { background: #5c75aa; color:#fff; }
    .TB .active span { background: #5c75aa; color:#fff; }

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter staggerlee

    (@staggerlee)

    Help Please. I know that I am missing a simple style setting or parameter. Thank you.

    This is my Test Site:

    https://www.baidacharitablesociety.org

    royho

    (@royho)

    In your navigation links write this

    Example:

    For Homepage <?php if (is_home()){ echo "class=\"current\"";}?>

    For Category Page <?php if (is_page('products-page')){ echo "class=\"current\"";}?>

    For Contact us Page <?php if (is_page('contact-us')){ echo "class=\"current\"";}?>

    Assuming you’re using li tags, put the above codes in there and style it the way you want.

    Thread Starter staggerlee

    (@staggerlee)

    Thank you. Not sure I did it correctly.

    I inserted the (is_page(‘about’) between

    • as follows, to no affect. (The Home page is working as I want by default with this theme) And I would like the affect to be dynamic with the wp_list_pages which follows.

      <div class=”TB”>

    <? unset($pages); ?>
    </div>

    royho

    (@royho)

    And you did style the .current class right?

    Thread Starter staggerlee

    (@staggerlee)

    I added the following to the stylsheet.

    /* Current */
    .current { background: #5c75aa; color:#fff; }

    And this line to the header.php

    • <?php if (is_page(‘about’)){ echo “class=\”current\””;}?>
    royho

    (@royho)

    You have to add it inside the li tag of your navigation.

    royho

    (@royho)

    Another words your navigation should look something like this..

    <ul id="nav">
            	<li id="nav1" <?php if (is_home()){ echo "class=\"current\"";}?>><a href="<?php echo get_option('home'); ?>">Home</a></li>
                <li id="nav2" <?php if (is_page('products-page')){ echo "class=\"current\"";}?>><a href="<?php echo get_option('home'); ?>/products-page">Buy Cookies</a></li>
                <li id="nav3" <?php if (is_category('articles')){ echo "class=\"current\"";}?>><a href="<?php echo get_option('home'); ?>/category/articles">Articles & Ideas</a></li>
                <li id="nav4" <?php if (is_page('contact-us')){ echo "class=\"current\"";}?>><a href="<?php echo get_option('home'); ?>/contact-us">Contact Us</a></li>
            </ul>
    Thread Starter staggerlee

    (@staggerlee)

    Thank you again. I am sorry for being clueless…..

    It appears within

    • see below, line 11.

      This is the entire section again:

      <!– start header LINE 1 –>
      <div class=”header”>
      <div id=”header-TXT”>
      <h1>/”><?php bloginfo(‘name’); ?></h1>
      </div>
      <div class=”TB”>

    <? unset($pages); ?>
    </div>

    royho

    (@royho)

    Just follow the format I pasted above and it should work flawlessly.

    Thread Starter staggerlee

    (@staggerlee)

    Thank you. I am not getting how to do this. When you write “navigation” I am assuming the header.php?

    There is no reference like this in the theme so I dont know what to do with it.

    <ul id=”nav”>
    <li id=”nav1″

    royho

    (@royho)

    Of course there is no reference to that as that is the code for my site. You should have your own but similar to it.

    You just have to follow the format I gave you.

    Thread Starter staggerlee

    (@staggerlee)

    the test site is :

    https://www.baidacharitablesociety.org/wp-admin with a PW:baida

    If you change it I will see will follow it.

    Thread Starter staggerlee

    (@staggerlee)

    please. :):)

    Thread Starter staggerlee

    (@staggerlee)

    Been at this specific thing for nearly 2 days……you can’t believe how much I have read.

    royho

    (@royho)

    Ok go check out the site now and click on each menu link

    Since you posted your password here, don’t forget to change it ASAP.!!

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Highlight the Active Page in Header Menu’ is closed to new replies.