Support

Account

Home Forums Add-ons Repeater Field pre_get_post and nested while loop Reply To: pre_get_post and nested while loop

  • The reason is that pre_get_posts is applied to all post queries and ACF does a query to get the posts in the relationship field. When you use pre_get_posts you need to check the details of the query being done before you alter the query. In this case just making sure that you only make changes to the main query. Your filter could have other side effects, like being run on the wrong post type or even being run int the admin causing the admin post list to be altered.