Moderator’s note: Moved to Howto.
I am trying to find a way to display a list of entries sorted by the month they were published and then the number of views for each article in descending order…
JUNE 2008
Article Z (234)
Article X (202)
Article Y (123)
MAY 2008
Article B (405)
Article C (309)
Article A (124)
I can do this by calling each month separately and ordering by view_count_one, but that leads to extra code for each month.
When I try to simplify the code like this, using the {date_heading} tag and calling multiple “orderby” commands…
{exp:weblog:entries weblog="whatever" orderby="date|view_count_one" sort="desc|desc" year="2008" rdf="off" dynamic="off"}
{date_heading display="monthly"}
{entry_date format="%F %Y"}
{/date_heading}
{title} ({view_count_one})
{/exp:weblog:entries}
...I get only halfway. The entries are sorted by month, but within each month they are also sorted by date, not by view_count_one.
I suspect this is a logic problem. Any ideas?