How can I group posts by months and years?

You can do it like so: global $post; $posts = get_posts( array( ‘post_type’ => ‘press’, ‘nopaging’ => true, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, // it’s DESC; not DSC // There’s no use setting posts_per_page when nopaging is enabled. // Because posts_per_page will be ignored when nopaging is enabled. ) ); $_year_mon = ”; // … Read more

Grouping categories by genre

It sounds to me like genre should be its own taxonomy. Then posts get assigned to both categories and genres. If you do it this way, here’s what you need to do to get everything working: First, register the taxonomy genre. Next, assuming you’re using the core posts and categories, go to Settings → Permalinks. … Read more

Group and list posts by custom taxonomy

I re-factored your code, there were quite some parts which seemed overly complex or used deprecated methods. In the code below, I’m looping through your terms, and within that loop, I’m finding the posts relating to that term. Probably there’s a more efficient way, since this is using several queries, but it should achieve the … Read more