前言介紹
- 這款 WordPress 外掛「Get Post」是 2008-11-24 上架。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2011-06-06,距離現在已有 5081 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
jtatum |
外掛標籤
page | post | latest | display | retrieve |
內容簡介
Get Post 是一個外掛,它新增了一個標籤,可讓您檢索並顯示最新的文章,這些文章由特定一組參數所識別。
當此外掛啟用後,在任何文章或頁面中,都可以使用以下格式的 get-post 標記:
[get-post tag=some-tag]
這將被替換為標記為給定標記的最新文章。
參數
這些參數控制著 get-post 擷取的文章。可以使用選項結合使用以建立一個標準擷取文章或文章列表的標準。
通過混合不同的標準,您可以對由外掛找到的文章進行高度控制。
[get-post tag=some-tag random show=3]
關於 WordPress 的一般注意事項:如果您指定 WordPress 找不到的標準,它會自己編制。例如,如果您指定不存在的標籤或分類,它將僅檢索最新的文章,而沒有任何指示出現錯誤的狀況。請務必確認您指定的選項是否符合您的意圖。
其中一些參數在指定時最好使用 slug。例如,在指定標籤時,最好使用 slug 值,而不是完整的標籤名稱。要找到 slug,請參閱管理面板 -> 文章 -> 文章標籤。slug 就列在該頁面的右側。
您可能希望使用帶有空格的選項值。這可以通過引號實現:
[get-post option="a value with spaces"]
tag(標籤):
指定要搜尋的標籤。應指定標籤的 slug。
[get-post tag=some-tag]
category(分類):
指定要搜尋的分類。應指定分類的 slug。
[get-post category=some-category]
show(顯示):
指定要顯示的文章數量。
[get-post show=5]
template(模板):
指定要使用的模板。此指定將覆蓋管理介面的選項中設置的模板。有關模板標記的更多詳細信息,請參閱模板部分。注意:如果輸入任何 HTML,請確認選擇了 HTML 編輯器而不是可視化編輯器。
[get-post template="
Title: {title}
"]random(隨機):
從符合標準的文章中選擇一篇隨機文章。
[get-post random]
default(默認):
這並不是一個實際的選項。預設情況下,get-post 會顯示最新的部落格文章。
[get-post]
模板
Get-post 附帶了一個預設模板,可在大多數佈景主題中適當呈現常見的文章詳情。您可以自定義此模板,以添加或刪除包含的文章資料。此外,您可以使用 [get-post] 標記的 template 參數來指定一個一次性的模板。
當使用 show 參數擷取多篇文章時,此時模板將重複顯示每個擷取的文章。
這些標籤將根據擷取的文章的值進行替換。例如,包含 {title} 的模板將實際上有擷取文章的標題,而不是單詞 title。
原文外掛簡介
Get Post adds a tag that allows you to retrieve and display the latest post
identified by a specific set of parameters.
When this plugin is active, any post or page can contain the get-post markup
as follows:
[get-post tag=some-tag]
This will be replaced with the latest post tagged with the given tag.
Parameters
The parameters control which posts are retrieved by get-post. Options can be
used in combination to build a list of criteria for post or posts to retrieve.
By mixing criteria, you can exert a lot of control over the post(s) which are
found by the plugin.
[get-post tag=some-tag random show=3]
One note on WordPress in general: if you specify criteria that WordPress can’t
match, it will make something up. For instance, if you specify a tag or
category that doesn’t exist, it will simply retrieve the latest post with no
indication that anything is wrong. Take care to ensure that the options you
specify are what you intend.
Several of these parameters work best when specifying the slugs. For instance,
when specifying a tag it’s best to use the slug value rather than the full
name of the tag. To find the slug, see the admin panel -> posts -> post tags.
The slug is listed right on that page.
You may wish to specify an option value with a space in it. This is
accomplished with quotes:
[get-post option="a value with spaces"]
tag:
Specify a tag to search for. The tag’s slug should be specified.
[get-post tag=some-tag]
category:
Specify a category to search for. The category’s slug should be specified.
[get-post category=some-category]
show:
Specify the number of posts to show.
[get-post show=5]
template:
Specify the template to use. This specification overrides the template set in
the options panel of the admin interface. See the template section for more
details on template tags. NOTE: If entering any HTML into this, please be
sure to select the HTML editor rather than the visual editor.
[get-post template="
Title: {title}
"]
random:
Select a random post from the matching criteria
[get-post random]
default:
This isn’t really an option. By default, get-post displays the latest blog
post.
[get-post]
Templates
Get-post ships with a default template that should render the usual post
details in a form that fits well with most themes. You can customize this
template to add or remove data from the included post. Additionally, you can
use the template parameter to the [get-post] tag to specify a one-off
template.
Using the show parameter will retrieve multiple posts. In this case, the
template will be repeated one time for each retrieved post.
These tags are replaced with the value from the retrieved post. For instance,
a template containing {title} will actually have the title of the retrieved
post, rather than the word title.
{title}:
The title of the post.
{content}:
The content of the post.
{author}:
The author of the post.
{date}:
The date the post was written.
{time}:
The time the post was written.
{permalink}:
A link to the post itself.
{authorlink}:
A link to all posts by the post’s author.
{id}:
The post’s ID number.
Examples
Indicate when your blog was last updated:
Blog last updated [get-post template="{date} at {time}."]
Link to the latest post:
Check out my post: [get-post template="{title}"]
How it works
This plugin does something a little bit unorthodox: It reenters “The
Loop” while the post content is being rendered. Then, it calls
whatever WordPress internal functions will safely work, using raw data from
$post when these functions are unsafe to call again. People curious about the
internals should examine class-get-post-getter.php. The class is structured
to be reusable by any other GPL2 projects.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Get Post」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0.0 | 1.0.1 | 1.0.2 | 2.0.0 | trunk |
延伸相關外掛(你可能也想知道)
Giveaway Helper 》Giveaway Helper 可以擷取文章評論者(尤其是贈獎活動文章)的電子郵件和名字。您可以輕鬆地選擇這些電子郵件或名字,將它們複製並粘貼到 Random.org 中選擇...。