Timeline for Query to return maximum of one post per author
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 9, 2013 at 16:32 | comment | added | Peter Willis III | I was wondering if you had any thoughts on this? While the other answer in this thread does "work", your solution is cleaner if we can make it show the "latest" post rather than the first post. I've tried a few different methods to "filter" the results further to get the ordering to show the latest post without success. | |
Jan 3, 2013 at 21:58 | comment | added | s_ha_dum |
Yeah, when you start messing with those filters you really have to know SQL since are literally just injecting raw SQL into the query. I know I can do this with pure SQL. Let me think about how to do it with WP_Query
|
|
Jan 3, 2013 at 16:42 | comment | added | Peter Willis III | Great thanks, appreciate that. It worked, but seems to be showing each authors oldest (rather than newest) post. I have tried putting an orderby parameter into the args, but I'm guessing the filter is overriding it as it's having no effect. I have discovered another filter called posts_orderby, which has more documentation than the posts_groupby function, but I'm not sure if this is what I need. I tried implementing the filter but it caused an error. | |
Jan 3, 2013 at 16:21 | history | answered | s_ha_dum | CC BY-SA 3.0 |