I haven’t tried it myself, but that sounds like something for the posts_distinct
or posts_groupby
filters:
function search_distinct() {
return "DISTINCT";
}
add_filter('posts_distinct', 'search_distinct');
Related Posts:
- Query all posts where a meta key does not exist
- Exclude a category from WP_Query
- Single loop for wp_query and wp_user_query
- WP_Query orderby custom field then post_date in one query
- query multiple taxonomies
- Custom Post Type, WP_Query and ‘orderby’
- Include post id[s] into WP_Query()
- Grab 5 latest posts from custom post type ‘announcements’
- Pagination Doesn’t Work
- Numeric pagination custom post type
- Using Query Posts With Multiple Post Types And A Taxonomy
- List with categories, subcategories and posts of custom posttype
- Sort the main query in subcategories/terms?
- Custom Taxonomy List links being re-written
- Can’t sort order of wp_query with 2 meta keys
- Get post info inside modal window?
- Want to filter only parent post in admin area
- Get count of custom post type created by current user
- Query Custom Post by Category
- Pagination Issue: Custom Post Type In Index
- Having trouble with custom date field for CPT query (WordPress)
- Quickest way to get last or oldest post date – WP Query
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Custom post query by taxonomy
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- CPT posts listed by category with custom rewrite URL, please help!
- How to use WP_Query in a CPT achive page?
- Use get_post_types to query only custom posts types
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- Setting proper query for multiple custom admin filters
- Returning a list of custom post types excluding those without a specific meta_value
- query private custom post type
- Query custom post type with tags
- Randomize Posts. Skip the first post in ascending order
- Pagination for Custom Taxonomy Page [duplicate]
- Isotope Filtering with Bootstrap Tabs – Custom Post Type Query Loop in each Tab (Have to click twice to filter)
- Custom taxonomy rewrite give pagination 404
- WP_Query order by custom field, then randomly order some of results
- Get Posts by multiple custom fields is not working
- How to display post list inside post
- How to have this permalink structure: post_type/postname/custom_inner_page
- Sort entries by date mixing two post types
- Advanced search form with filters for custom taxonomies
- custom post type search by reference id
- Showing specific post in order of array wp_query
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Print current post category during WP_Query
- Multiple Custom Post Type queries, how to DRY it up
- Custom WP_Query always respond with 200 status even when no entry
- WPDB for post count on post
- post_per_page ignored in WP_Query
- Pagination 404 on Index with custom query
- WP_Query parameter conflict
- Retrieving meta-box from a custom-post-type
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- Cannot get custom post
- Custom post type and standard post not displaying or working
- Display custom post type for specific user
- Get all post from a post type
- Trying to add a class to post links
- A faster way to query custom post types with multiple conditions?
- Custom Post Type Archive Pagination
- List all Custom Post Type posts excluding certain Taxnomy term
- WP_Query: Posts within category OR custom post type
- Two queries – one with checkbox ticked, one without – comparing meta_query
- Custom post type pagination error
- WP query_posts group by meta field related
- WP Query from two Custom Post type fields as statement
- Apply category query clause to posts of custom type
- custom post type and a “sticky” position taxonomy
- Display post count for a specific month
- Query to Exclude Child Pages from Custom Post Type Archive
- WP_query has incorrect wp_posts.post_name = ‘asc’ when I have custom post type called ‘order’
- Randomizing WordPress Custom Post Type Sorting Through Them Without Page Refresh
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- How to output custom post type title on custom page with category next to it?
- How to sort by multiple values in a nested WP_Query
- WP_Query to display number of custom post type filtered (order by) taxonomy
- 2 modal windows with ACF content on Archive page
- Custom Post Type – Display all, wrap in groups of 3
- Staggering featured post using ‘sticky’
- Ajax load more inside custom post type taxonomy
- Create a custom wp_query from a specific custom post type with specific taxonomy
- SQL LIKE in WP_Query
- How can you use a page for a custom post type?
- Query breaking with ‘posts_per_page’ => -1
- WP Query with multiple post types ordered by custom meta date then published date
- Query Pulling the same post twice
- Values inside a custom field to determine which category posts to display
- WP_Query get posts where post_name is empty
- How do I sort post listing by child post count?
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Querying meta values within an array
- Filter Custom post type by another Custom post type
- Archive page – problem with pagination
- Assign a tag to custom post type using a query
- Query order by a numeric ACF field