View Single Post
Old 11-03-2008, 11:06 AM   #1 (permalink)
ncmason
The Visitor
 
Join Date: May 2008
Posts: 3
Thanks: 0
ncmason is on a distinguished road
Default WordPress "current_page_item"

I can't get this figured out...

I'm using the wp_list_pages function in WordPress to show my pages in my navbar.

I was able to make some edits to the classes.php file in "/wp/wp-includes".

PHP Code:
PHP Code:
<?php if (is_home()) {$highlight "page_item";} else {$highlight "current_page_item";}?> 

    <div id="navbar"> 
            <ul> 

                <li class="<?php echo $highlight?>"><a href="<?php echo get_settings('home'); ?>">Home</a></li> 
                <?php wp_list_pages('title_li='); ?> 
            </ul> 
        </div>
Above is the code for my navbar.

I want the HTML output to look like this:

HTML Code:
<li class="current_page_item"><a href="http://masonsklut.com">Home</a></li>
<li><a href="http://masonsklut.com/archives/">Archives</a></li>
<li><a href="http://masonsklut.com/contact/">Contact</a></li>
<li><a href="http://masonsklut.com/donate/">Donate</a></li>
Thanks,
Mason

Last edited by ncmason : 03-18-2009 at 10:41 PM.
ncmason is offline  
Reply With Quote