Title: Setting pre_get_posts wrong
Last modified: April 15, 2022

---

# Setting pre_get_posts wrong

 *  [balwansingh2008](https://wordpress.org/support/users/balwansingh2008/)
 * (@balwansingh2008)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-pre_get_posts-wrong/)
 * This plugin causes a conflict with many other plugins/themes. More below:
 * In the file ‘includes/general-hooks.php’ line number 3843.
 * You are using action “pre_get_posts” and the callback function uses below code:
   `
   $post_types = [ 'portfolio', 'post' ];`
 * You are setting post_type to include portfolio and post, but other plugins or
   themes can use a different post_type but this is overwriting them.
 * Instead please use this code:
 * `$post_types = [ 'portfolio', $query->get('post_type') ];`
 * so it returns your post_type portfolio and the original post_type instead of 
   post.
    -  This topic was modified 4 years, 1 month ago by [balwansingh2008](https://wordpress.org/support/users/balwansingh2008/).

The topic ‘Setting pre_get_posts wrong’ is closed to new replies.

 * ![](https://ps.w.org/auxin-portfolio/assets/icon-256x256.png?rev=1604992)
 * [Premium Portfolio Features for Phlox theme](https://wordpress.org/plugins/auxin-portfolio/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auxin-portfolio/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auxin-portfolio/)
 * [Active Topics](https://wordpress.org/support/plugin/auxin-portfolio/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auxin-portfolio/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auxin-portfolio/reviews/)

## Tags

 * [plugin conflict](https://wordpress.org/support/topic-tag/plugin-conflict/)

 * 0 replies
 * 1 participant
 * Last reply from: [balwansingh2008](https://wordpress.org/support/users/balwansingh2008/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/setting-pre_get_posts-wrong/)
 * Status: not resolved