[WordPress] 外掛分享: Around this date in the past…

首頁外掛目錄 › Around this date in the past…
10+
安裝啟用
尚無評分
6808 天前
最後更新
問題解決
WordPress 2.0+ v0.7 上架:2007-03-15

內容簡介

[ 網站中的西班牙文註釋 ] [ 網站中的加泰羅尼亞文註釋 ]

此外掛程式顯示過去某個日期的文章/貼文(如果有的話)。此外掛程式高度可自訂。預設會取得一年前此時週圍一週的文章資料。

重要提示:如果您的側邊欄支援新的 WordPress 小工具,您最好使用「過去日期的文章 … 小工具版」這個外掛程式。
點擊這裡檢視:
[ https://wordpress.org/extend/plugins/plugin/around-this-date-in-the-past-widget-edition/ ]

用法

將這個函數放置在您想要顯示連結的位置。

您可以使用預設參數呼叫函數:

<?php around_this_date(); ?>

或者自訂:

<?php around_this_date ($before = '去年這個週: ', $after = '<br />', $daysbefore = '3', $daysafter = '3', $mode='1', $yearsago = '1'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?>
或者
<?php around_this_date ($before = '去年這個週: ', $after = '<br />', $daysbefore = '3', $daysafter = '3', $mode='2', $lastxyears = '2'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?>
或者
<?php around_this_date ($before = '去年這個週: ', $after = '<br />', $daysbefore = '3', $daysafter = '3', $mode='3', $sinceyear = '2004'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?><h3>設定參數</h3>
$before = 顯示連結前的文字,預設為「去年這個週:」
$after = 顯示連結後的文字,預設為「」
$daysbefore = 在一年前之前會顯示的天數文章,預設為「3」(3 天前)
$daysafter = 在一年前之後會顯示的天數文章,預設為「3」(3 天後)
$mode = 選擇您想要運作的模式,預設為「1」(X 年前)
模式 1: 取得 X 年前這個日期的文章。
模式 2: 取得過去 X 年這個日期的文章。
模式 3: 取得從 X 年開始這個日期的文章。
$yearsago = 顯示「X」年前的文章,預設為「1」(1 年),僅當選擇 MODE 1 時使用。
$lastxyears = 顯示最新「X」年的文章,預設為「1」(1 年),僅當選擇 MODE 2 時使用。
$sinceyear = 顯示從「X」年開始的文章,預設為「2005」(自 2005 年開始),僅當選擇 MODE 3 時使用。
$limit = 擷取的文章數量,預設為「4」。
$none = 當沒有文章時顯示的文字。預設為「none」。
$showdate = 旁邊顯示日期。「0」代表取消顯示,「1」代表開啟顯示(預設為關閉)。
$dateformat = 顯示旁邊日期的格式(如果勾選)。請參閱 http://www.php.net/date
$showexcerpt = 在連結旁顯示節錄。.「0」代表取消顯示,「1」代表開啟顯示(預設為關閉)。<h3>自訂顯示</h3>

除了函數中提供的選項外,您也可以使用 CSS 大幅自訂輸出的外觀。以下是可用的類別:
ul.atd-list {} // 基本的清單容器。
li.atd-year {} // 年度標題。
atd-yXXXX {} // 依年分的標題,例如 atd-y2006、atd-y2005 …
ul.atd-yearlylist {} // 每年文章的清單容器。
li.atd-entry {} // 包含每一篇過去日期文章的清單項目。
atd-yXXXX {} // 依年分的標題,例如 atd-y2006、atd-y2005 …
atd-mXX {} // 依月份的標題,例如 atd-m01、atd-m02 … atd-m12。
atd-dXX {} // 依日期的標題,例如 atd-d01、atd-d02 … atd-d31。
atd-XXXXXXXX {} // 依日期的標題,例如 atd-2006-01-31、atd-2005-02-01 …

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.7) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「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 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:

Or configure it:
', $daysbefore = '3', $daysafter = '3', $mode='1', $yearsago = '1'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?>
or
', $daysbefore = '3', $daysafter = '3', $mode='2', $lastxyears = '2'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?>
or
', $daysbefore = '3', $daysafter = '3', $mode='3', $sinceyear = '2004'′, $limit = '5', $none= 'none', $showdate = '0', $dateformat = 'y', $showexcerpt = '0'); ?>

Configuration parameters

$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).

Customize display

In adition to the options avaliable in the function you can highly customize the apearance of the output by using CSS. These are the classes avaliable:
ul.atd-list {} // base list container.
li.atd-year {} // Yearly headers.
atd-yXXXX {} //yearly based class, eg. atd-y2006, atd-y2005 …
ul.atd-yearlylist {} // list container for each year around this date posts.
li.atd-entry {} // list items containing each around this date posts.
atd-yXXXX {} //yearly based class, eg. atd-y2006, atd-y2005 …
atd-mXX {} //montly based class, eg. atd-m01, atd-m02 … atd-m12.
atd-dXX {} //dayly based class, eg. adt-d01, atd-d02 … atd-d31.
atd-XXXXXXXX {} //date based class, eg. atd-20061205, atd-20050304 …
a.atd-entry-title {} // Link to the post.
.atd-entry-date {} // span containing the date, if $showdate enabled.
.atd-entry-excerpt {} // span containing the excerpt, if $showexcerpt enabled.
License
This plugin is released under the GPL license. See license.txt for details.
Credits and Acknowledgments
This plugin is based on:
– “One year ago” plugin released by Borja Fernandez
[ http://www.lamateporunyogur.net/wp-plugins/one-year-ago/ ]
– “Wayback” plugin realeaased by Chris Goringe
[ http://code.goringe.net/WordPress/ ]
Thanks to Borja Fernandez[ http://www.lamateporunyogur.net ] and Chris Goringe [ http://tis.goringe.net ] for writing those plugins and to Luis Pérez and Mike Koepke for their contributions.
ToDo
Nothing else planed by now.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon