Title: wp_query &#8211; $query to include duplicate content
Last modified: August 22, 2016

---

# wp_query – $query to include duplicate content

 *  [Fra Calo](https://wordpress.org/support/users/frank-maio/)
 * (@frank-maio)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/wp_query-query-to-include-duplicate-content/)
 * I have an array $foo with a list of page IDs and I’d like to modify $query to
   display this array (including duplicates); so far I’m using posts__in but this
   automatically excludes duplicates, here’s what I’ve tried:
 *     ```
       add_action('pre_get_posts','alter_query');
   
       function alter_query($query){
        $foo = array('one'   => get_theme_mod("featured__one", "default_value" ),
                     'two'   => get_theme_mod("featured__two", "default_value" ),
                     'three' => get_theme_mod("featured__three", "default_value" ),
                     'four'  => get_theme_mod("featured__four", "default_value" ),
       );
   
               if ( $query->is_home() && $query->is_main_query() ) {
               $query->set( 'post_type',  'page'  );
               $query->set ('post__in', $foo ) ;
   
           }
       }
       ```
   
 * The problem so far is I can’t find a property that accepts my array of page ids
   and (possibly) outputs this array keeping the input order.

The topic ‘wp_query – $query to include duplicate content’ is closed to new replies.

## Tags

 * [pre_get_posts](https://wordpress.org/support/topic-tag/pre_get_posts/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * 0 replies
 * 1 participant
 * Last reply from: [Fra Calo](https://wordpress.org/support/users/frank-maio/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/wp_query-query-to-include-duplicate-content/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
