WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_pages() Problem! (2 posts)

  1. oba08
    Member
    Posted 5 years ago #

    Howdy,

    I've got a problem that hopefully can be solved pretty easily!

    Essentially, the WordPress codex states for the "wp_list_pages()" tag that

    By default, wp_list_pages() generates a nested, unordered list of WordPress Pages created with the Write > Page admin panel. You can remove the outermost item (li.pagenav) and list (ul) by setting the title_li parameter to an empty string.

    I would like to have an empty string for the title, but keep the ul, li, etc styling (default styling if I did have a title)

    Is this possible?

    Cheers

  2. educationthemes
    Member
    Posted 5 years ago #

    To create a list of pages using the wp_list_pages() tag without having a title on there just use the following code:

    <?php wp_list_pages('title_li='); ?>

    That will remove the title from the list but keep the <ul> with <li> tags for each pages nested inside.

Topic Closed

This topic has been closed to new replies.

About this Topic