• Hi,

    I am trying to use the function wp_list_pages() to generate a simple site map, with a couple of pages excluded from the list, but the exclude argument doesn’t seem to be working. Am I doing something wrong? The list generates fine, and accepts other arguments, it just seems to be ignoring “exclude”.

    Here is the code i am using:

    <ul>
    	<?php
    	$args = array(
    	 'title_li' => '',
    	'exclude' => '4,6',
    	'sort_column'  => 'post_title'
    	);
           wp_list_pages($args);
    	?>
    </ul>

    Can anyone see where I am going wrong and help? Thanks.

    John

Viewing 3 replies - 1 through 3 (of 3 total)
  • try with (4,6)

    Thread Starter John O

    (@jossoway)

    Hi – thanks for the suggestion, but when I replace ‘4,6’ with (4,6) I get:

    Parse error: syntax error, unexpected ',' in (and then it indicates the line i have changed)

    I also tried with (‘4,6’) but that got ignored again. 🙁

    oops.. me bad. i did a check on my site and your code’s perfect as-is.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress function wp_list_pages not accepting "exclude" argument’ is closed to new replies.