Title: Custom Post Type taxonomy loop
Last modified: August 19, 2016

---

# Custom Post Type taxonomy loop

 *  [slaifer](https://wordpress.org/support/users/slaifer/)
 * (@slaifer)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/custom-post-type-taxonomy-loop/)
 * Hello guys, i need to query posts from a specific custom post type and from a
   specific taxonomy category.
 * I’ve got the following loop
 *     ```
       <?php $folio_loop = new WP_Query( array( 'post_type' => 'portfolio', 'posts_per_page' => get_post_meta($post->ID, 'ep_portfolio_posts_per_page', true), 'orderby' => 'menu_order' ) ); ?>
   
       	 	<?php while ( $folio_loop->have_posts() ) : $folio_loop->the_post(); ?>
   
       	 	<?php endwhile; ?>
       ```
   
 * now, i’ve created a taxonomy named portfolio_categories , and i’ve created a 
   category (using the taxonomy) with the name “One Column” what should i have to
   do in order to get posts only from that taxonomy category ?
 * Thanks…

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

 *  [Josh Leuze](https://wordpress.org/support/users/jleuze/)
 * (@jleuze)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/custom-post-type-taxonomy-loop/#post-1898523)
 * Try adding the taxonomy and term to your query, like this:
 *     ```
       <?php $folio_loop = new WP_Query( array( 'portfolio_categories' => 'one-column', 'post_type' => 'portfolio', 'posts_per_page' => get_post_meta($post->ID, 'ep_portfolio_posts_per_page', true), 'orderby' => 'menu_order' ) ); ?>
   
       	 	<?php while ( $folio_loop->have_posts() ) : $folio_loop->the_post(); ?>
   
       		<?php endwhile; ?>
       ```
   
 *  [artsfantasy-1](https://wordpress.org/support/users/artsfantasy-1/)
 * (@artsfantasy-1)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/custom-post-type-taxonomy-loop/#post-1898824)
 * super! worked beautifully for me!

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

The topic ‘Custom Post Type taxonomy loop’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [artsfantasy-1](https://wordpress.org/support/users/artsfantasy-1/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/custom-post-type-taxonomy-loop/#post-1898824)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
