內容簡介
標準的 Archives widget 不允許設定太多參數。您只能指定:
標題,
是否顯示文章計數。
使用 EG-Archives widget,您可以選擇:
標題,
列表格式(簡單或下拉式列表),
類型:年度、月度等等,
顯示特定類別的存檔,
列表欄位數(1 或 2)
還新增了一種特殊的類型:「混合年度/月份」類型。使用此類型,您可以在指定日期前以年度模式顯示存檔,之後則以月份模式顯示。此類型可讓列表縮短,若您每年發表文章過少,將非常有用。舉例:
2011 年 8 月
2011 年 4 月
2011 年 2 月
2011 年 1 月
2010 年
2009 年
翻譯
此外採用了 4 種語言的翻譯。以下是每位貢獻者:
法文 (FR)
德文 (DE) - Frank W. Hempel
保加利亞文 (BG) - Web Geek、Dimitar Kolevski
俄文 (RU) - FatCow
使用方法
EG-Archives 新增了一個 widget 和一個範本標籤。
Widget
前往外觀 / Widget 選單,
啟用名為「EG-Archives」的 widget,
透過 Widget 選單進行設定。
範本標籤
您可以在模板任意位置顯示存檔列表,語法為:<?php eg_get_archives('arguments'); ?>
此處的 arguments 與標準 WordPress 函式 wp_get_archives 的相同。
type (字串) 要顯示存檔列表類型。有效值:yearly、monthly、daily、weekly、postbypost。預設為 monthly,
limit (整數) 要獲取的存檔數量。預設為不限,
format (字串) 存檔列表格式。有效值:
html - 採用 HTML 清單 () 和前後字串。預設值,
option - 採用選取標籤 () 或下拉式選單標籤 (),
link - 採用連結標籤 (),
custom - 採用自訂列表及前後字串。
before (字串) 採用 html 或 custom 格式選項時要放在連結前的文字。沒有預設值,
after (字串) 採用 html 或 custom 格式選項時要放在連結後的文字。沒有預設值,
show_post_count (布林值) 是否要在存檔中顯示文章數。適用於所有 type,除了「postbypost」。預設為 0,
echo (布林值) 是否要顯示輸出,或是回傳。預設為 1。
eg_get_archives 接受另一個參數:
pivot (整數) 「軸心」年度。在軸心之前,存檔以年度模式顯示,在之後以月份模式顯示。預設是目前年度(2009 年)
columns (整數) 要顯示的列表欄位數。可能的值是 1 或 2。預設為 1。
授權
此外採用了 4 種語言的翻譯。以下是每位貢獻者:
此外採用了 4 種語言的翻譯。以下是每位貢獻者:
此插件採用 GPL 釋出,您可以在個人或商業部落格上免費使用它。
翻譯
此插件採用法文和英文翻譯,請參閱
外掛標籤
開發者團隊
原文外掛簡介
The standard Archives widget doesn’t accept a lot of parameters. You can just specify
a title,
if you want to display posts count or not.
With the EG-Archives widget, you can choose
the title,
the format of the list (simple or dropdown list),
the type: Yearly, Monthly, …
category, to display archives for only specific categories,
Number of columns (1 or 2)
A specific type is added: the “mixed Yearly/monthly” type.
With this type, you can display list of archives in yearly mode before a specified year, and in monthly mode after this specified date. This type allows to shorten list, and is very useful if you don’t publish too many posts per year. Example:
August 2011
April 2011
February 2011
January 2011
2010
2009
Translations
The plugin comes up with 4 translations. Thanks to the following people for their contributions:
French (FR)
German (DE) – Frank W. Hempel
Bulgarian (BG) – Web Geek, Dimitar Kolevski
Russian (RU) – FatCow
Usage
EG-Archives adds a widget, and a template tag.
Widget
Go to the Appearence / Widgets menu,
Active the widget named: EG-Archives,
Configure it, through the widget menu.
Template tag
You can display the archives list, anywhere in your templates, with the function:
Arguments are the same than the standard WordPress function wp_get_archives.
type (string) The type of archive list to display. Valid values: yearly, monthly, daily, weekly, postbypost. Default is monthly,
limit (integer) Number of archives to get. Default is no limit,
format (string) Format for the archive list. Valid values:
html – In HTML list (
) tags and before and after strings. This is the default,
option – In select () or dropdown option () tags,
link – Within link () tags,
custom – Custom list using the before and after strings.
before (string) Text to place before the link when using the html or custom for format option. There is no default,
after (string) Text to place after the link when using the html or custom for format option. There is no default,
show_post_count (boolean) Display number of posts in an archive (1 – true) or do not (0 – false). For use with all type except ‘postbypost’. Defaults to 0,
echo (boolean) Display the output (1 – true) or return it (0 – false). Defaults to 1.
eg_get_archives accept an additional arguments:
pivot (integer) The “pivot” year. Before the pivot, archives are listed i yearly mode, after archives are listed in monthly mode. Default: current year (currently 2009)
columns (integer) Number of columns to display list. Possible values are 1 or 2. Default is 1.
Licence
This plugin is released under the GPL, you can use it free of charge on your personal or commercial blog.
Translations
The plugin comes with French and English translations, please refer to the WordPress Codex for more information about activating the translation. If you want to help to translate the plugin to your language, please have a look at the eg_series.pot file which contains all defintions and may be used with a gettext editor like Poedit (Windows).
