Created
April 2, 2015 00:44
-
-
Save ckunte/467e09ee4370f26a23a1 to your computer and use it in GitHub Desktop.
Dateline linked to archive by day, month and year (for WordPress)
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
// | |
// WordPress has a built-in support for archive by day, archive by month, | |
// and archive by year, and so, this following snippet converts the dateline | |
// below each post linkable by day, month, and year to the archive. | |
// 2008 ckunte | |
// | |
<?php | |
$arc_day = get_the_time('j'); | |
$arc_month = get_the_time('m'); | |
$arc_year = get_the_time('Y'); | |
?> | |
// Converting'em into linkable dates | |
<?php the_time('l'); ?>, | |
<a href="<?php echo get_day_link($arc_year, $arc_month, $arc_day); ?>"><?php the_time('jS') ?></a> | |
<a href="<?php echo get_month_link($arc_year, $arc_month); ?>"><?php the_time('F') ?></a> | |
<a href="<?php echo get_year_link($arc_year); ?>"><?php the_time('Y') ?></a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment