Output yearly archive within a page
You can just use a normal query to grab all posts (which are, by default, sorted date descending), and break them up as you loop over them: <?php $posts = new WP_Query( array( ‘posts_per_page’ => -1, ‘post_type’ => ‘press-releases’ ) ); if ( $posts->have_posts() ) : ?> <ul class=”accordion”><?php while ( $posts->have_posts() ) : $posts->the_post(); … Read more