• Resolved pattonyu

    (@pattonyu)


    I spent hours to figure out how to highlight static “home” page. Part of my header:

    <div id="navigacija">
    		<ul id="nav">
    			<li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
    			<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order'); ?>
    		</ul>
    	</div>

    and CSS (thanx to Esmi) for active tab menu highlight:
    #nav .current_page_item,#nav .current_page_parent,#nav .current_page_ancestor {background:#000;color:#fff;}

Viewing 6 replies - 1 through 6 (of 6 total)
  • Rry:

    <div id="navigacija">
    <ul id="nav">
    <li<?php if( is_home() || is_front_page() ) echo ' class="current_page_item";?>)><a href="<?php echo get_settings('home'); ?>">Home</a></li>
    <?php wp_list_pages('title_li=&depth=2&sort_column=menu_order'); ?>
    </ul>
    </div>
    Thread Starter pattonyu

    (@pattonyu)

    hmmm, something is wrong in:
    <li<?php if( is_home() || is_front_page() ) echo ' class="current_page_item";?>)><a href="<?php echo get_settings('home'); ?>">Home</a></li>

    I’ve got a error message:

    Parse error: parse error, expecting ','' or‘;” in C:\wamp\www\wordpress\wp-content\themes\AKM\header.php on line 59

    Try:

    <li<?php if( is_home() || is_front_page() ) echo ' class="current_page_item"';?>)><a href="<?php echo get_settings('home'); ?>">Home</a></li>

    Thread Starter pattonyu

    (@pattonyu)

    I’m sorry, something gone wrong ??
    Yes, I have “Home” tab highlighted, but it occupied navigation bar and pushed other tabs down below. I mean, whole navigation bar becomes “Home” tab with mouse over effect.
    I’m sorry.

    Site url?

    Thread Starter pattonyu

    (@pattonyu)

    it is on my localhost, wampserver, and thanks to you Esmi, here is the code that works perfectly:
    #nav .current_page_item, #nav .current_page_parent, #nav .current_page_ancestor {background:#000;color:#fff;}

    and in header.php:

    <div id="navigacija">
    		<ul id="nav">
    			<li class="<?php if (is_front_page()) { echo "current_page_item"; } ?>"><a href="<?php echo get_settings('home'); ?>">home</a></li>
    			<?php wp_list_pages('title_li=&depth=2&sort_column=menu_order'); ?>
    		</ul>
    	</div>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘static frontpage highlighting problem’ is closed to new replies.