Block internal search queries with pre_get_posts and regex rules
Block internal search queries with pre_get_posts and regex rules
Block internal search queries with pre_get_posts and regex rules
Order posts by taxonomy terms
Merge CPT Taxonomy and Post Taxonomy in $query->set
problem with setting tax_query in pre_get_posts
Is there a way for me to use the theme page.php (or single.php) template, intercepting the query to replace it with a wp_user_query or does this have to be a custom template job? No, WP pages are either post archives or singular posts, based on a WP_Query. You can create virtual pages based on rewrite … Read more
Should be add_action not add_filter when using pre_get_posts add_action( ‘pre_get_posts’, ‘thefunction’); function thefunction($query) { if ( ! is_admin() && $query->is_main_query() ) { // Not a query for an admin page. // It’s the main query for a front end page of your site. // Let’s change the query using arguments. $query->set( ‘orderby’, ‘rand’ ); } … Read more
“pre_get_posts” orderby custom date field in different format?
`offset` WP_Query argument dont work via `pre_get_posts`
How to use pre_get_posts on archive page custom post type
Exclude post with taxonomy and from the terms (taxonomy & tag) posts count