Hot answers tagged

2

Use the Index of the post currently being displayed to trigger when your custom content is rendered. current_post can be found on WP_Query from within the loop. <?php while( $archive_query->have_posts() ) : $archive_query->the_post(); ?> <article <?php post_class(); ?>> The Content </article> <?...


2

When 'is_post_type_archive()' return true? is_post_type_archive() returns true for custom post type archives and false for default posts. Use is_archive() to check for default posts.


1

At first glance, that should just work, as long as you've flushed your rewrite rules. You can do that by going into the settings and saving permalinks again.


1

Here's a more readable version of the solution provided by Michael <?php $posts = new WP_Query(array('posts_per_page' => -1)); if ($posts->have_posts()): ?> <ul id="archives"> <?php $prev_month = ''; while ($posts->have_posts()): $posts->the_post(); if (get_the_date('F Y') != $prev_month): $...



Only top voted, non community-wiki answers of a minimum length are eligible