This queries all of a WordPress users posts but does not include custom post types. How can I specify a custom post type for it to include?
<?php
if ( is_user_logged_in() ) {
global $current_user;
get_currentuserinfo();
echo 'User ID: ' . $current_user->ID . "\n";
//The Query
query_posts('author='.$current_user->ID );
//The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();
the_title();
echo "<br>";
endwhile; else:
echo "The user has not contributed anything!";
endif;
//Reset Query
wp_reset_query();
} else {
echo 'Welcome, visitor!';
};
?>
http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters
query_postsuses similar parameters asWP_Queryso you can do something like…If you want more than one post type to be displated the
post_typeparameter also accepts an array of post types.