Support » Fixing WordPress » wp_list_pages include doesn’t work

  • Hi there, I am using wp_list_pages but I only want to include certain pages. Here’s what I did:

    wp_list_pages(‘include=2,3,6&title_li= ‘)

    but that doesn’t work. Strange thing is that exclude works perfectly fine.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I suspect the “include” works only on the 2.1.x branch and you say you are using 2.0.x.
    (I might be wrong, of course)

    I am using 2.1.3 and the include option of wp_list_pages has a bug in it. It will only list sub-pages if you have also asked it to list the parent pages of those sub-pages. In other words if page #1 is the parent of page #2 and you type wp_list_pages("title_li=&depth=0&include=2") you will get nothing but if you type wp_list_pages("title_li=&depth=0&include=1,2") then you’ll get both of them.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_list_pages include doesn’t work’ is closed to new replies.