Title: WP Query Customization
Last modified: August 21, 2016

---

# WP Query Customization

 *  [sdjentertainment](https://wordpress.org/support/users/sdjentertainment/)
 * (@sdjentertainment)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wp-query-customization/)
 * Hey There,
 * I’m developing a site that has a couple of custom post types, **post** and **
   as_seen_in**. I need all the posts along with ordering them by month. I’ve managed
   to get all the posts in both custom post types with the following.
 *     ```
       $monthly = new WP_Query(array('post_type' => array( 'post', 'as_seen_in' ), 'posts_per_page' => -1, 'orderby' => 'date'));
       if( $monthly->have_posts() ) : while( $monthly->have_posts() ) : $monthly->the_post();
       ```
   
 * However, within the loop above I only want to display the **as_seen_in** posts
   that have a specific meta key/value of **display_on_main_page/yes**
 * If any one has any thoughts it would be greatly appreciated.
 * Cheers,
    Simon

The topic ‘WP Query Customization’ is closed to new replies.

## Tags

 * [custom post](https://wordpress.org/support/topic-tag/custom-post/)
 * [key](https://wordpress.org/support/topic-tag/key/)
 * [post-type](https://wordpress.org/support/topic-tag/post-type/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [value](https://wordpress.org/support/topic-tag/value/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [sdjentertainment](https://wordpress.org/support/users/sdjentertainment/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/wp-query-customization/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
