[wp-hackers] Can't use wp_list_pages multiple times on a template file

Jeremy Boggs jeremyboggs at gmail.com
Fri Feb 29 22:48:17 GMT 2008

Hi List,

Prior to version 2.2.2 I was able to use the wp_list_pages() function
multiple times with different arguments, like so:

			<ul id="nav">
			<?php wp_list_pages('exclude=14,22,144&title_li=&sort_column=menu_order&depth=1');

			<?php if(is_page(11)) { ?>
				<ul id="subnav">
					<?php wp_list_pages("title_li=&child_of=11&sort_column=menu_order&depth=1");
			<?php } ?>

I had this code in the header.php file in my template. After upgrading
to 2.3.2, however, the page fails to load beginning with the second
use of the wp_list_pages function. If I change the arguments in the
second instance of wp_list_pages to match the arguments in the first,
however, the page loads fine. In other words, I can no longer use
wp_list_pages multiple times with different arguments.

Has anyone else come across this problem, and if so is there a fix? or
am I missing something?


Jeremy Boggs
Creative Lead, Center for History and New Media
George Mason University
4400 University Drive, MSN 1E7
Fairfax, VA 22030-4444

More information about the wp-hackers mailing list