I'm looking for a way to ensure a query always returns posts, even if the original query was empty. The query is a custom post type archive query, and my goal is to change a query var if the query has no results.
In the pre_get_posts
filter, $query->have_posts()
always returns no posts, so I can't find a way to do this – is there any way to predict whether a query will have results in the pre_get_posts
filter?