[WordPress] 外掛分享: Smarter Archives

首頁外掛目錄 › Smarter Archives
100+
安裝啟用
★★★★
4/5 分(2 則評價)
2040 天前
最後更新
問題解決
v3.2.5 上架:2007-09-15

內容簡介

當您在文章或頁面中使用[smarter-archives]縮略語時,它會被替換為從您開始發布以來的每一年的列表,其中包含該年份的每個月的鏈接列表。但是,該外掛非常聰明,如果您在任何給定月份沒有創建任何內容,則不會為該月份創建任何鏈接。查看截圖部分,以查看其演示示例。

查看“使用方法”部分,以獲取縮略語使用的完整參數列表,以及如何使用它們自定義您的檔案列表。

月份名稱經由WordPress翻譯API國際化。其中包括一個POT文件,如果您需要翻譯,請隨意進行翻譯,並在GitHub上發送新的pull request。如果您不知道如何使用GitHub,您還可以直接聯繫我。到目前為止,這些是已經被翻譯的語言:

荷蘭語(nl_NL)
法語(fr_FR)
德語(de_DE)
意大利語(it_IT)
西班牙語(es_ES)
俄語(ru_RU)

該外掛的原始概念來自Justin Blanton的一個外掛。

使用方法

[smarter-archives]縮略語包含以下參數(包括默認值):

mode(默認值:output) — 如果設置為output,該外掛將打印列表。將其設置為false以返回值
wrapper_class(默認值:smart-archives) — 給包圍列表的標籤(默認為<div>)
wrapper_tag(默認值:div) — 包圍列表的標籤
year_link_class(默認值:year-link) — 給每年鏈接的類
year_tag(默認值:無) — 每年組的標籤
year_class(默認值:無) — 每年組的類
after_year(默認值::) — 在年份和月份列表之間的值
month_link_class(默認值:month-link) — 給每個月份鏈接的類
month_tag(默認值:span) — 每個月份的標籤
after_month(默認值:&nbsp;) — 月份之間的填充
empty_month_class(默認值:empty-month) — 為空月份應用的類(可以用灰色顏色顯示)
order(默認值:DESC) — 顯示年份的順序(升序的ASC,降序的DESC)

進階用法

該外掛包含一個get_smarter_archives()函數,可返回包含年份,月份和帖子計數的原始數組。您可以使用它進行最終自定義。

示例用法

[smarter-archives order="DESC" after_month="&bull;"]<h3>許可</h3>
此程序是自由軟體;您可以重新發佈它和/或
修改它,依據GNU通用公共許可證
根據自由軟體基金會發佈的版本;第二版
許可協議或(根據您的選擇)任何稍後版本。

本程式是基於“原樣提供”的,沒有任何明示或暗示的擔保;
包括但不限於,適銷性和特定用途的適用性擔保。
作為使用者您必須對使用本軟體後造成的任何直接或間接的損害負責。
有關許可的詳細資訊,請參閱GNU通用公共許可證。

外掛標籤

開發者團隊

⬇ 下載最新版 (v3.2.5) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Smarter Archives」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

When you use the [smarter-archives] shortcode anywhere in a post or a page, it gets replaced by a listing of every year since you started posting, with a list of links to each month for that year. However, the plugin is smart enough to know if you didn’t create any content in any given month, and doesn’t make a link for that month. See the Screenshots section for an example of it in action.
See the Usage section for a complete list of the arguments the shortcode takes, and how you can use them to customize your archives listing.
The month names are internationalized with the WordPress translation API. A POT file is included, and if you want to translate please feel free to do so and submit a new pull request on GitHub. If you do not know how to use GitHub, you can also contact me directly. Here are the translations that have been done so far:

Dutch (nl_NL)
French (fr_FR)
German (de_DE)
Italian (it_IT)
Spanish (es_ES)
Russian (ru_RU)

The original concept for this plugin comes from a plugin by Justin Blanton.
Usage
The [smarter-archives] shortcode takes these arguments (default values included):

mode (default: output) — if it’s set to output, the plugin prints the listing. Set it to false to return the value
wrapper_class (default: smart-archives) — class given to the tag wrapped around the listing (

by default)
wrapper_tag (default: div) — tag wrapped around the listing
year_link_class (default: year-link) — class given to each year links
year_tag (default: p) — tag around each year group
year_class (default: none) — class for the tag around each year group
after_year (default: 🙂 — value after the year and before the list of months
month_link_class (default: month-link) — class given to each month link
month_tag (default: span) — tag around each month
after_month (default:  ) — spacer between months
empty_month_class (default: empty-month) — class applied to empty months (can use this to gray them out)
order (default: DESC) — order the years are shown in (ASC for ascending, DESC for descending)

Advanced Usage
There is a function, get_smarter_archives(), that returns the raw array with the years, months, and post counts. You can use this for ultimate customization.
Example Usage
[smarter-archives order="DESC" after_month="•"]

License

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A full version of the license is included with the plugin in license.txt.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon