Return to Snippet

Revision: 50224
at August 16, 2011 11:28 by kbrown


Initial Code
<div id="mainnav">
<ul id="mainnav">

        <li<?php
                if (is_home())
                {
                echo " id=\"current\"";
                }?>>
                <a href="<?php bloginfo('url') ?>">Home</a>
        </li>
          <li<?php
                if (is_page('about'))
                {
                echo " id=\"current\"";
                }?>>
                <a href="<?php bloginfo('url') ?>/about">About</a>
        </li>
          <li<?php
                if (is_page('lessons'))
                {
                echo " id=\"current\"";
                }?>>
                <a href="<?php bloginfo('url') ?>/lessons">Lesson Pricing</a>
        </li>
          <li<?php
                if (is_page('student-gallery'))
                {
                echo " id=\"current\"";
                }?>>
                <a href="<?php bloginfo('url') ?>/student-gallery">Student Gallery</a>
        </li>
           <li<?php
                if (is_page('blog'))
                {
                echo " id=\"current\"";
                }?>>
                <a href="<?php bloginfo('url') ?>/blog">Blog</a>
        </li>
           <li<?php
                if (is_page('contact'))
                {
                echo " id=\"current\"";
                }?>>
                <a href="<?php bloginfo('url') ?>/contact">Contact</a>
        </li>
</ul></div>

Initial URL
http://wordpress.org/support/topic/how-to-menu-highlight-current-page

Initial Description

                                

Initial Title
Wordpress - Highlight Nav

Initial Tags

                                

Initial Language
PHP