• Hi all,

    I tried to search for this, but couldn’t find anything. But basically, I am using the wp_list_pages() function to list the pages I have in my blog. But I noticed index.php doesn’t show up as a page. What is the best way to list it? I am aware I could simply make it appear as a list item, and then using the wp_list_pages(). But I was thinking there was another way to do it?

    Thanks,

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you’re not using a static page as your front page, your front page isn’t class as a WordPress Page. The “fix” is use something like:

    <ul>
    <li<?php if(is_home()) echo ' class="current_page_item"';?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php wp_list_pages('title_li&sort_column=post_name&sort_order=asc&hierarchical=1'); ?>
    </ul>

    Hi,

    As of more recent versions of WP, you can use wp_page_menu() to create a Page list with a “Home” link.

    – Tim

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Listing the index.php using wp_list_pages() function’ is closed to new replies.