Mark - here's a repost of the answer I posted on the other dupe question:
The best approach here, since you need your custom fields parsed, is to first find the entry_ids of the latest 4 entries from distinct authors, and then pass those to the channel:entries
tag through an embed using the entry_id
parameter.
This should work (be sure to replace the channel_id
with the appropriate integer). Replace your entire current chunk of code with this:
{embed="embeds/_latest_per_member" entry_ids="{exp:query sql="SELECT entry_id, author_id FROM exp_channel_titles WHERE entry_date IN( SELECT MAX(entry_date) FROM exp_channel_titles WHERE status != 'closed' AND channel_id = 1 GROUP BY author_id ) ORDER BY entry_date DESC LIMIT 4" backspace="1"}{entry_id}|{/exp:query}"}
Then your embeds/_latest_per_member template can look something like this:
{exp:channel:entries channel="channel_name" entry_id="{embed:entry_ids}"}
{author_id}<br />
<a href="{path=portfolios/gallery/{username}}"><img src="{thumbnail}"></a><br>
<a href="{path=portfolios/gallery/{username}}">{title}</a><br />
{/exp:channel:entries}
You had mentioned that this code gave you a recursive error - that means that you've put another call to the embed within the embed. Don't do that.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…