內容簡介
WP-Cat2Calendar 是一個外掛,他可以透過分類(們)將文章組織成一個日曆。它支援 shortcode,因此您可以為部落格上不同的文章或頁面建立各種不同的設置的日曆。在日曆上的每天會列出所選類別上當天已發佈的文章。
用法
在您的文章 / 頁面中使用 WP-Cat2Calendar shortcode 來添加日曆。
您可以使用下列 PHP 代碼來添加一個日曆:
$options = array(...);
global $wpCat2Calendar;
echo $wpCat2Calendar->display($options);
選項
cat_id - 分類 ID 的逗號分隔列表。1.0 - 1.0.1 – 默認未分類。1.0.2 – 默認所有類別。您還可以使用特殊關鍵字 post_author,這將被替換為 shortcode 所放置的文章作者 ID。WordPress 的錯誤(目前在2.8.5中仍存在)會在 wp-includes/query.php 的第1979行中排除多個作者的文章。
author_id - 作者 ID 的逗號分隔列表。(所有作者默認)自1.0.2起您還可以使用特殊關鍵字 post_author,這將被替換為 shortcode 所放置的文章作者 ID。WordPress 的錯誤(目前在2.8.5中仍存在)會在 wp-includes/query.php 的第1979行中排除多個作者的文章。
year - 您想在日歷中顯示的年份。(默認為當前年份)
month - 您想在日曆中顯示的月份。(默認為當前月份)
show_nav - 顯示 / 隱藏月份 / 年份的導航,0 或 1(默認為0)
show_date - 顯示 / 隱藏選定月份 / 年份的標題,0 或 1(默認為0)。如果顯示導航,就沒有效果。
allow_change_date - 允許用戶通過日曆進行導航,即使隱藏了導航並且用戶有直接鏈接也會顯示。(如果顯示導航,就沒有影響。)
範例
[WP-Cat2Calendar cat_id="3,4" show_nav="1" year="2009" month="10"]
它將顯示 WordPress 分類 ID 為 3 和 4 的文章日曆,顯示導航,並且日曆的開始日期將為 2009 年 10 月。
[WP-Cat2Calendar cat_id="1" show_nav="1"]
它將顯示 WordPress 分類 ID 為 1 的文章日曆,顯示導航,並且日曆的開始日期將為當前日期。
[WP-Cat2Calendar author_id="1, 2, 3" cat_id="-4,-5"]
它將顯示由使用者 ID 為 1、2、3 發佈的文章日曆,排除 ID 為 4 和 5 的 WordPress 所有類別。
[WP-Cat2Calendar author_id="-post_author"]
顯示由任何使用者發佈的文章日曆,但是排除shortcode 所放置的文章作者的文章。
[WP-Cat2Calendar author_id="post_author"]
顯示由shortcode 所放置的文章作者發佈的文章日曆。
有關詳細信息,請訪問WP-Cat2Calendar 首頁。
外掛標籤
開發者團隊
原文外掛簡介
WP-Cat2Calendar is a plugin which can organize posts into a calendar by category(/ies). It supports a shortcode so you can create a lot of calendars with different settings for different posts or pages on your blog. Every day in the calendar will list the posts published on that day for the selected categories.
Usage
Use WP-Cat2Calendar shortcode in your post/page to add a calendar.
You can add a calendar using the php lines:
$options = array(...);
global $wpCat2Calendar;
echo $wpCat2Calendar->display($options);
Options
cat_id – a comma separated list of category ID’s.1.0 – 1.0.1 – uncategorized by default.1.0.2 – all categories by default.You also can use a special keyword post_author which will be replaced with a post author ID where shortcode is placed.WordPress bug (still in 2.8.5) at wp-includes/query.php line 1979 in exclusion so you can exclude only one author, but you can include multiple.
author_id – a comma separated list of author ID’s. (all authors by default)since: 1.0.2You also can use a special keyword post_author which will be replaced with a post author ID where shortcode is placed.WordPress bug (still in 2.8.5) at wp-includes/query.php line 1979 in exclusion so you can exclude only one author, but you can include multiple.
year – year you want to display in calendar (current year by default)
month – month you want to display in calendar (current month by default)
show_nav – show/hide month/year navigation, 0 or 1 (0 by default)
show_date – show/hide selected month/year title, 0 or 1 (0 by default). Have no affect if navigation is shown.
allow_change_date – allow user to navigate through a calendar even if navigation is hidden and user has direct link. Has no affect if navigation is shown.
Examples
[WP-Cat2Calendar cat_id="3,4" show_nav="1" year="2009" month="10"]
It will show a calendar of posts for WordPress categories with ID 3 and 4 with navigation and the start date for a calendar will be October, 2009.
[WP-Cat2Calendar cat_id="1" show_nav="1"]
It will show a calendar of posts for WordPress category ID 1 with navigation and the start date for a calendar will be current date.
[WP-Cat2Calendar author_id="1, 2, 3" cat_id="-4,-5"]
It will show a calendar of posts posted by users with ID 1, 2, 3 for all WordPress categories excluding categories with ID 4 and 5.
[WP-Cat2Calendar author_id="-post_author"]
Show a calendar of posts posted by any user except a posts which belongs to the author of post where shortcode is placed.
[WP-Cat2Calendar author_id="post_author"]
Show a calendar of posts posted by the author of post where shortcode is placed.
See the WP-Cat2Calendar homepage for further information.
