Title: Custom Post Type in Loop Query
Last modified: August 24, 2016

---

# Custom Post Type in Loop Query

 *  [poontificate](https://wordpress.org/support/users/poontificate/)
 * (@poontificate)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-in-loop-query/)
 * Have a multisite with pods creating custom post type and a simple loop as stated
   below. However when querying standard post types with custom post types, the 
   custom post types do not get retrieved.
 * Any idea what could cause this will be much appreciated.
 * eg:
    array( ‘post’, ‘page’ ) = retrieves both array( ‘post’, ‘event’ ) = retrieves
   only post array( ‘people’, ‘event’ ) = retrieves both
 * Query:
    $args = array( ‘post_type’ => array( ‘post’, ‘event’ ), ‘orderby’ => ‘
   date’, ‘order’ => ‘DESC’, ‘cat’ => -485, ‘paged’ => $page ); query_posts( $args);

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

 *  [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-in-loop-query/#post-5971317)
 * query_posts is definitely not what you should be using, you should be using `
   $query = new WP_Query( $args );`
 * As far a post types are concerned, there’s absolutely no reason there should 
   be discrepancies like this when using ‘post_type’ arrays. Pods doesn’t have to
   hook into this area because WordPress supports it natively, so perhaps the switch
   above may help somehow.
 *  Thread Starter [poontificate](https://wordpress.org/support/users/poontificate/)
 * (@poontificate)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/custom-post-type-in-loop-query/#post-5971596)
 * Thanks Scott, changing to wp-query solved some other issue I was having. For 
   anyone else having similar issue, realized that Polylang resolves the frontpage
   a little differently that other pages. I know i should have checked plugins first,
   newb mistake.

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

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

## Tags

 * [cpt](https://wordpress.org/support/topic-tag/cpt/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [query](https://wordpress.org/support/topic-tag/query/)

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

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
