Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
22 views

How do I group results from wp-query

I've got a custom post type for staff. The fields are first_name, last_name, job_title, telephone, email, and notes. All staff are categorized by location using WP core Category. I need to output the ...
banacan's user avatar
0 votes
2 answers
286 views

How to put posts with some taxonomy on top of others in `pre_get_posts`

The following tax_query returns only matched posts (with 'matchedstring' IN taxonomy array): function only_returns_matched_posts( $query ) { if( !$query->is_main_query() || is_admin() ) ...
mikmikmik's user avatar
  • 101
1 vote
1 answer
1k views

Group and list posts by custom taxonomy

I'm trying to list posts from a CPT named "exposition" and group them based on a custom taxonomy called "date-exposition" (which are meant to be years such as 2010, 2015, 2017,...) ...
TonioLip's user avatar
1 vote
1 answer
1k views

Multiple taxonomy And acf filter group by

I have a widget that must display my custom post type. I don't display title or content, but just the values of 3 custom fields (acf) : start date, end date and city. Here is my loop. I grab all the ...
blogob's user avatar
  • 137
1 vote
0 answers
261 views

Use posts_groupby filter with part of string in wp_query?

I am using posts_groupby filter to group by a custom field my wordpress posts. Is there any way using wp_query and posts_groupby to group my posts using part of a string of the custom field? Any help ...
stefanosn's user avatar
  • 133
0 votes
1 answer
445 views

SELECT TOP 1 in wp_query for each groupby meta value

Is there any way using wp_query class to execute SELECT TOP 1 sql command while using groupby for each meta_value results. I need the wp_query to select only the first one of each groupby meta_value ...
stefanosn's user avatar
  • 133
0 votes
1 answer
4k views

How can I group posts by months and years?

I have posts under a custom post type which I like to display in a page grouped by Year and Month. In the page template that I create, I managed to separate them by month, but still without grouping ...
MAR's user avatar
  • 109
5 votes
1 answer
2k views

Select All in Parent Category, Group by Child Category?

I am trying to format a custom post type for a "series". Each post is an Episode, each Episode belongs to a Season, and each Season belongs to a series (just like a TV show). I have the following: ...
tdc's user avatar
  • 271
2 votes
1 answer
6k views

How to search for posts IN OR title OR content OR author?

I have looked at many posts and questions regarding searches for custom meta, but I want to search for posts and include those if the search query matches an author name. I have come up with the ...
Gixty's user avatar
  • 1,097