Last active
August 29, 2015 14:00
-
-
Save calliaweb/11062030 to your computer and use it in GitHub Desktop.
Add date title to genesis date archives
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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