Last active
January 12, 2017 14:55
-
-
Save shaunkrd/091fcb44f9921b980d60d0a4f15e5551 to your computer and use it in GitHub Desktop.
Show date filter used to access WordPress posts archive
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 if (is_date()) : ?> | |
<?php | |
// get the date filter to display below | |
if ( is_day() ) $date_filter = get_the_date('F jS Y'); | |
else if ( is_month() ) $date_filter = get_the_date('F Y'); | |
else if ( is_year() ) $date_filter = get_the_date('Y'); | |
?> | |
<p>Archive for: <?php echo $date_filter; ?></p> | |
<?php endif; // END if (is_date()) ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment