Title: Custom Post Type list posts
Last modified: August 20, 2016

---

# Custom Post Type list posts

 *  Resolved [WatsonN](https://wordpress.org/support/users/watsonn/)
 * (@watsonn)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/custom-post-type-list-posts/)
 * I know there is a way but I have not been able to get it right, yet.
    I have 
   four custom post types and I want to put each one into a list of all their post
   titles. I know I need `the_title()` and `the_permalink()` But how do I specify
   which post type to pull from?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/custom-post-type-list-posts/#post-2187554)
 * If you are using WP_Query you could use the post_type parameter:
 * `$query = new WP_Query( array( 'post_type' => array( 'post', 'page', 'movie','
   book' ) ) );`
 * Or for a single post type:
 * `$query = new WP_Query( array( 'post_type' => 'book' ) );`
 *  Thread Starter [WatsonN](https://wordpress.org/support/users/watsonn/)
 * (@watsonn)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/custom-post-type-list-posts/#post-2187577)
 * Thank you, that was exactly what I needed!
 *     ```
       $query = new WP_Query( array( 'post_type' => array( 'labs', 'activities', 'projects', 'testreview' ) ) );
   
       while ( $query->have_posts() ) : $query->the_post();
       	echo '<li><a href="';
       	the_permalink();
       	echo '">';
       	the_title();
       	echo '</a></li>';
       endwhile;
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom Post Type list posts’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [list](https://wordpress.org/support/topic-tag/list/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [title](https://wordpress.org/support/topic-tag/title/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [WatsonN](https://wordpress.org/support/users/watsonn/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/custom-post-type-list-posts/#post-2187577)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
