Title: Custom Post Query
Last modified: August 22, 2016

---

# Custom Post Query

 *  [Wayn](https://wordpress.org/support/users/shnactor1/)
 * (@shnactor1)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/custom-post-query-1/)
 * Hi All
 * I need to query a custom post by its tag?
 * Does anyone know the wp query for this?

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

 *  [B_M](https://wordpress.org/support/users/b_m/)
 * (@b_m)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/custom-post-query-1/#post-5397100)
 * Hi,
 * Do you mean display your custom post type?
 *     ```
       <?php $loop = new WP_Query( array( 'post_type' => 'custom_post_type', 'posts_per_page' => -1 ) ); ?>
   
       <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
   
       <?php the_title(); ?>
   
       <?php the_content(); ?>
       ```
   
 * This will display all the posts for custom_post_type.
 * Is this what you wanted?
 *  Thread Starter [Wayn](https://wordpress.org/support/users/shnactor1/)
 * (@shnactor1)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/custom-post-query-1/#post-5397101)
 * Thank you
 * I want to display a custom post type and then a certain tag withinh that custom
   post
 * Eg
 * Custom post is staff
 * Tag is cleaners

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

The topic ‘Custom Post Query’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Wayn](https://wordpress.org/support/users/shnactor1/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/custom-post-query-1/#post-5397101)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
