Support » Fixing WordPress » How to edit the wp_list_pages

  • 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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • whooami



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

    your answer is on that page.

    yes i did.

    This is the code right:

    elseif(wp_list_pages(“child_of=”.$post->ID.”&echo=0″)) { // page has children

    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…




    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.

    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.

    well it still adds the ul tag or some reason. 🙁


Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to edit the wp_list_pages’ is closed to new replies.