WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Someone help me understand why the following do not output anything:

wp_list_pages( 'post_type=post' )
wp_list_pages( 'post_type=event' )

Yet the following work as expected:

wp_list_pages( 'post_type=page' )
WP_Query( 'post_type=post' )
WP_Query( 'post_type=event' )

I'm stumped.

share|improve this question
up vote 2 down vote accepted

wp_list_pages will only output hierarchical post types. If we look at the function in source, we'll see that it calls get_pages to load pages for output. If we look at get_pages function in source, we'll see:

// Make sure the post type is hierarchical
$hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );
if ( !in_array( $post_type, $hierarchical_post_types ) )
    return false;

The default post post type is not hierarchical, so the function outputs nothing. If your event post type is also not hierarchical then that would explain why it also outputs nothing.

share|improve this answer
Thanks for the clarification! It's a bummer there's no wp_list_posts() and wp_get_archives() does not include custom post types by default. – Zade Aug 30 '12 at 6:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.