Search for meta_query does not return any result if combined with title
Search for meta_query does not return any result if combined with title
Search for meta_query does not return any result if combined with title
Figured it out, it was simpler than I expected. /** * Include catalog posts in archives, even though they’re not “public” * * @param WP_Query $query * @return WP_Query */ function wpse415668_catalog_posts_in_archives(WP_Query $query): WP_Query { if (! $query->is_admin() && $query->is_main_query() && $query->is_tax(“catalog_category”)) { $query->set(“post_type”, “catalog”); } return $query; } add_filter(“pre_get_posts”, “wpse415668_catalog_posts_in_archives”);
Hide empty categories on widget
Duplicating event posts in wordpress
Sorting by Title for Post Archive Categories for Custom Post Type
How to exclude first 2 posts from a specific category for a custom post type archive page
You could try modifying the tax query to use the relation parameter and add a second clause that matches any post that does not have the matched string value in the meta array. See Taxonomy Parameters. EDIT: Thank you for pointing that out, Tom. You’re correct, I’ve updated to reflect. function group_matched_posts_at_top( $query ) { … Read more
pre_get_posts is an action hook used for modifying the arguments passed to the WP_Query class, and if you’re filtering the posts in the list table at wp-admin/edit.php, then yes, you would use that hook. However, since you’re filtering the terms in the list table at wp-admin/edit-tags.php, then the hook that you should have used is … Read more
pre_get_posts has php notice when not on CPT archive
You can add a filter on posts_clauses to; left join additional columns for each meta filter add order by clause base on those column values. Something like below should work, assuming your meta key is start_date and the value has the actual date format Y-m-d and your post type is talks add_filter( ‘posts_clauses’, function ($clauses, … Read more