wp_list_pages include index.php (4 posts)

  1. idbehold
    Posted 10 years ago #

    Is there anyway to make your home page come up in the list of pages. Or is there a way to format how wp_list_pages outputs the pages, because right now it comes out like:

    < ul >
    < li >< a href="/somepage/" >somepage< /a >< /li >
    < li >< a href="/otherpage/" >otherpage< /a >< /li >
    < /ul>

    So ther is no way for me to get say:

    < li >< a href="index.php" >Home< /a >< /li>

    into that list. How can this be done?

  2. Minna
    Posted 10 years ago #

    There was a thread on this a while ago but I just can't find it. I don't know if what I've done was in that thread, but here's a bit of my sidebar code where I've added a link to my homepage:
    <li><a href="#">Home</a></li>
    <?php wp_list_pages('title_li='); ?></ul>

    The important part is that title_li= with nothing after it. From cached Codex: "Displays no heading for list, and list is not wrapped in <li><ul>, </ul></li> tags. (Note the absence of any space after the = sign.)"

  3. idbehold
    Posted 10 years ago #

    Thanks, that worked.

  4. Vikia
    Posted 10 years ago #

    Thanks for posting, I was looking for this myself.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.