WordPress.org

Ready to get started?Download WordPress

Forums

How to edit the wp_list_pages (7 posts)

  1. olajideolaolorun
    Member
    Posted 6 years ago #

    I dont like the way the template function wp_list_pages lists the pages. Its puts a ul inside a li tag and that messes up my template. How can i change that? I just want it to list the li tags and remove the ul.

  2. whooami
    Member
    Posted 6 years ago #

    http://codex.wordpress.org/Template_Tags/wp_list_pages

    did you look at the codex page for using the template tag?

    your answer is on that page.

  3. olajideolaolorun
    Member
    Posted 6 years ago #

    yes i did.

    This is the code right:

    elseif(wp_list_pages("child_of=".$post->ID."&echo=0")) { // page has children
    wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->ID);

    What that code does is the fact that it addes the ul tag. I dont want that.... I tried putting a >'< by the title_li and got an error...

  4. whooami
    Member
    Posted 6 years ago #

    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.

    you appear to be doing that.

  5. olajideolaolorun
    Member
    Posted 6 years ago #

    Oh my bad about the last part... read something wrong. Ok, i still want it to display subpages in hierarchical form but just for it to take out the ul tag.

  6. olajideolaolorun
    Member
    Posted 6 years ago #

    well it still adds the ul tag or some reason. :(

  7. olajideolaolorun
    Member
    Posted 6 years ago #

    anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic