Forums

is_page tag not working properly (2 posts)

  1. astanley
    Member
    Posted 2 years ago #

    I can't seem to figure out why the is_page tag isn't working correctly, but the is_home tag works fine. Is there anything that is popping out at anyone else that I can't see below?

    Thanks for the help!

    <body>
    
    <div class="section" id="header">
    
    <div class="holder">
    
    <img src="<?php bloginfo('template_directory');?>/images/header/logo-enigma.jpg" width="200" height="51" alt="Enigma Logo" id="logo" />
    
    <ul id="menu">
    
    <li <?php if(is_page('About')) { echo 'id="menu-current"'; } ?>>/about/" id="menu-about">ABOUT
    
    <li <?php if(is_home()) { echo 'id="menu-current"'; } ?>>/blog/" id="menu-blog">BLOG
    
    <li <?php if(is_page('Work')) { echo 'id="menu-current"'; } ?>>/work/" id="menu-work">WORK
    
    <li <?php if(is_page('Contact')) { echo 'id="menu-current"'; } ?>>/contact/" id="menu-contact">CONTACT
    
    </div><!-- /holder -->
    
    </div><!-- /section header -->
  2. furiber
    Member
    Posted 2 years ago #

    i don't know why you are getting the error. Since im not to good in php im not the best one to tell. Yet i've seen you're using it jeust to do something wordpress do always: adding he current class to the links.
    in that case you are better of just using the wp_list_pages function with it's diferent paramenters.

    hope it's usefull.

Topic Closed

This topic has been closed to new replies.

About this Topic