tags:

views:

23

answers:

2

I'm new to PHP, trying to find a way to list the pages for my menu and also include index.php

Here's what I'm using:

<div id="navigation">
        <ul>    
        <?php wp_list_pages('sort_column=menu_order&sort_order=desc&title_li=&depth=2&')?>
        </ul>   
</div><!-- end id:navigation -->

Site can be viewed here: http://www.hospiceball.com/wp/

+2  A: 

Just do somethig like this:

<div id="navigation">
        <ul>    
            <li><a href='<?php bloginfo('url') ?>'>Home</a></li>
        <?php wp_list_pages('sort_column=menu_order&sort_order=desc&title_li=&depth=2&')?>
        </ul>   
</div><!-- end id:navigation -->

As you can see, I included a new <li> element with a like to the home page. That info can be retrieved using the bloginfo function.

Edit I have read the Richard's answer and I think it's a better approach. I actually didn't know about the show_home option. I'd do in the way I wrote only if I need to customize the anchor of the homepage URL.

Cristian
thanks so much @ Cristian C.
blackessej
+1  A: 

You can use wp_page_menu with the show_home option.

wp_page_menu('sort_column=menu_order&sort_order=desc&title_li=&depth=2&show_home=1')
Richard M