Around this date in the past…
[ Notas en castellano en la web ] [ Notes en catala a la web ] It shows around this date entries/posts in the past (if they exist). It is highly customizable. By default it retreives a week around the current day 1 year ago. IMPORTANT : If your sidebar supports the new WordPress Widgets, you might b
[ Notas en castellano en la web ] [ Notes en catala a la web ]
It shows around this date entries/posts in the past (if they exist). It is highly customizable. By default it retreives a week around the current day 1 year ago.
IMPORTANT : If your sidebar supports the new WordPress Widgets, you might better use the “Around this date in the past… – Widget Edition” plugin. Check-it here: [ https://wordpress.org/extend/plugins/plugin/around-this-date-in-the-past-widget-edition/ ]
Usage
Place the function wherever you want to show the links.
You can call to function with default parameters:
<?php around_this_date(); ?>
Or configure it:
<?php around_this_date ($before = 'One year ago... ', $after = '<br />', $daysbefore = '3', $daysafter = '3', $mode='1', $yearsago = '1'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?> or <?php around_this_date ($before = 'One year ago... ', $after = '<br />', $daysbefore = '3', $daysafter = '3', $mode='2', $lastxyears = '2'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?> or <?php around_this_date ($before = 'One year ago... ', $after = '<br />', $daysbefore = '3', $daysafter = '3', $mode='3', $sinceyear = '2004'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?><h3>Configuration parameters</h3> $before = Code will show before links. Defaults to ‘This week last year…: ‘ $after = Code will show after links. Defaults to ‘’ $daysbefore = Days’ posts that will show before one year ago. By default ‘3' (3 days before) $daysafter = Days’ posts that will show after one year ago. By default ‘3' (3 days after) $mode = Select the mode that you want the widget to work. By default ‘1' (X years ago) Mode 1: get posts around this date from X years ago. Mode 2: get posts around this date for the last X years. Mode 3: get posts around this date since year X. $yearsago = It shows “X” years ago posts. By default ‘1' (1 year). ONLY IF MODE 1 IS SELECTED. $lastxyears = It shows posts por the last "X" years. By default ‘1' (1 year). ONLY IF MODE 2 IS SELECTED. $sinceyear = It shows posts since the year "X". By default ‘2005' (since year 2005). ONLY IF MODE 3 IS SELECTED. $limit = Number of posts to retrieve. By default ‘4'. $none = Text shown when there are no posts. By default 'none'. $showdate = Show dates next to the links. ('0' or '1', by default '0', disabled) $dateformat = Format of the date displayed next to the links (if checked). See http://www.php.net/date $showexcerpt = Show the excerpt next to the links. ('0' or '1', by default '0', disabled).<h3>Customize display</h3>