Skip to content

Instantly share code, notes, and snippets.

@calliaweb
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calliaweb/11062030 to your computer and use it in GitHub Desktop.
Save calliaweb/11062030 to your computer and use it in GitHub Desktop.
Add date title to genesis date archives
<?php
// Do NOT include the opening php tag above
add_action( 'genesis_before_loop','jmw_add_archive_date_title', 15 );
/**
* Add date headline to date archive pages.
*
* If we're not on a date archive page then nothing extra is displayed.
*
* The date is marked up as a level 1 heading.
*
* @return null Return early if not date archive
*/
function jmw_add_archive_date_title() {
if( !is_date() ) {
return;
}
echo '<div class="archive-description">';
echo '<h1 class="archive-title">'. single_month_title( ' ', FALSE ) .' Archive</h1>';
echo '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment