[WordPress] 外掛分享: Get Posts

前言介紹

  • 這款 WordPress 外掛「Get Posts」是 2009-08-20 上架。 目前已經下架不再更新,不建議安裝使用。
  • 目前有 500 個安裝啟用數。
  • 上一次更新是 2013-12-23,距離現在已有 4448 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.5.1 以上版本才可以安裝。
  • 有 3 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

nurelm |

外掛標籤

list | post | posts | get_posts | formatting |

內容簡介

此外掛可將短碼標籤放入任何靜態頁面或文章中,以使用 get_posts 範本標籤來顯示文章列表。更多此外掛關於詳細資訊,請查看它的主要頁面。

預設會顯示最新的五篇文章,以相反的日期排序,但它亦包含從 get_posts 範本標籤中提供的任何選項。

只需將以下程式碼放入頁面或文章中,您可以在同一頁面上使用多次:

[get_posts]

上述預設用法將返回相反日期排序的最新的5篇文章。

除了 get_posts 範本標籤提供的所有選項,它也會接受一些額外的選項:

ul_class。這是指定項目清單的類別,預設為“get_posts_class”。

fields。這是要顯示的逗號分隔欄位列表,取自 wp_posts 資料表欄位,您可以在其中使用一些更有趣的欄位,例如 post_title、post_date 和 post_excerpt(您會在上面引用的表格描述中找到更多欄位)。默認為“post_title”。除了標準欄位外,您還可以在這裡使用 "post_featured_image" 來撤回對應的特色圖片,或 "custom_text" 來添加自己的文本。

fields_classes。這是另一個逗號分隔的列表,可讓您為上述指定的每個欄位分配一個類別,該類別將通過包在標籤中提供,而不會影響該欄位。此列表的默認值為 "post_title_class"。

fields_make_link。另一個逗號分隔的列表,讓您選擇哪些欄位是指向該文章的連結。它是一個值為"true"或"false"的列表,值"true"將使相應的欄位成為連結。默認為 "true"。

post_featured_image_size。默認為“縮略圖(thumbnail)”,但也可以設定為“中等(medium)”,“大型(large)”和“完整尺寸(full)”(您上傳的圖像大小)。

custom_text_value。如果您選擇 "custom_text" 作為要顯示的欄位之一,則會顯示此內容。

以下是一些範例:

[get_posts tag="my favorite tag" numberposts=5 orderby="title"]

這會顯示標題為 “my favourite tag” 的五篇文章,以標題排序的項目清單。

[get_posts tag="my favorite tag" fields="post_title, post_date, post_excerpt, post_featured_image, custom_text" fields_classes="class1, class2, class3, class4, class5" fields_make_link="true, false, false, false, true", custom_text_value="Read More"]

此選項會顯示標題為 “my favourite tag” 的文章列表,包括標題、日期和摘要。標題將以 "class1" 為類,日期以 "class2" 為類,摘要以 "class3" 為類。只有標題會提供指向文章的鏈接。此外還會顯示文章的特色圖(縮略圖大小)和 “Read More”。

請查看get_posts 範本標籤文檔,以獲取更多關於此選單的詳細資訊。

原文外掛簡介

This plugin adds the ability to put a shortcode tag in any static page or post and have it display a list of posts using the get_posts template tag. For more detailed information about this plugin, please check out its home page.
By default it will show the 5 most recent posts ordered in reverse date order,
but it will accept any of the options provided by the get_posts template tag.
To use it, just put the following into the HTML of any page or post, use as many times as you like on the same page:
[get_posts]

This default usage will return the last 5 posts in reverse chronological order.
Along with all the options provided by the get_posts template tag, it will also
accept a few additional options:

ul_class. This is the class assigned to the bullet list, with a default of “get_posts_class”.

fields. This is a comma separated list of fields to show, taken right from the wp_posts database table fields. Some of the more interesting fields you can use in this list include post_title, post_date, and post_excerpt (you’ll find more in the table description referenced above). The default is “post_title”. In addition to standard fields, you can also use “post_featured_image” here to pull the corresponding featured image, or “custom_text” to add your own text.

fields_classes. Another comma separated list that lets you assign a class to each of the fields specified above, which will be provided via a tag wrapped around the field. The default value for this list is “post_title_class”.

fields_make_link. One more comma separated list that lets you choose which of your fields are links to the post. It is a list of either “true” or “false” values … values of “true” make the corresponding field a link. The default is “true”.

post_featured_image_size. Defaults to “thumbnail” but can also be “medium”, “large” and “full” (the size of the image you uploaded).

custom_text_value. If you choose “custom_text” as one of the fields to display, this is what will be displayed.

A couple of examples:
[get_posts tag="my favorite tag" numberposts=5 orderby="title]

Shows a bulleted list consisting of the titles of 5 posts with the tag “my favorite tag” ordered by title.
[get_posts tag="my favorite tag" fields="post_title, post_date, post_excerpt, post_featured_image, custom_text" fields_classes="class1, class2, class3, class4, class5" fields_make_link="true, false, false, false, true", custom_text_value="Read More"]

Shows a bulleted list consisting of the titles, post dates, and excerpts of posts with the tag “my favorite tag”. The title will be wrapped in a tag with a class of “class1”, the date with a of class “class2”, and the excerpt with “class3”. Only the title will provide a link to the post. Also shows the post’s featured image (in thumbnail size) and “Read More”.
Check the get_posts template tag documentation for all of the possible options associated with the tag, and the wp_posts database table fields for all possible field names.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Get Posts」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | trunk |

延伸相關外掛(你可能也想知道)

  • WP Shortcodes Plugin — Shortcodes Ultimate 》Shortcodes Ultimate 是一個全面的視覺與功能性元素收集,您可以在文章編輯器、文字小工具甚至是範本檔案中使用。使用 Shortcodes Ultimate,您可以輕鬆地建...。
  • Post Duplicator 》這個外掛是用來製作選定文章的完全一模一樣複製。它支援自訂文章類型、自訂分類和自訂欄位。, *注意: 評論不會被複製到新文章。, 這個外掛的目的是為了快速且...。
  • GenerateBlocks 》將不同的功能整合至編輯器,但並不會因為過多的一維方塊造成內容過於臃腫。使用 GenerateBlocks,您只需深入學習少量的方塊,即可用於創建任何內容。, Genera...。
  • YARPP – Yet Another Related Posts Plugin 》WordPress 相關文章外掛, Yet Another Related Posts Plugin (YARPP) 是一個經過專業維護、高度自訂和功能豐富的外掛程式,可以顯示與當前文章相關的頁面、文...。
  • WP Popular Posts 》WordPress Popular Posts 是一個高度可定製的小工具,可以顯示您最受歡迎的文章。, 主要特點, , 多小工具功能 – 您可以在您的博客上擁有多個 WordPress...。
  • Public Post Preview 》此外掛可讓您分享一個鏈接給匿名使用者,以便他們在發布前預覽文章(或其他公開文章類型)。, 您是否曾經與沒有訪問您網站權限的人共同撰寫文章,並需要給予...。
  • WP Meta and Date Remover 》移除點擊文章的Meta、作者和日期。 安裝、啟用,完成!, 如何移除文章和頁面的作者Meta和日期?, , 安裝 WP Meta and Date remover。, 啟用外掛。, 選擇隱藏...。
  • List category posts 》List Category Posts 可以讓你透過使用 [catlist] 短碼在文章或頁面中按類別列出文章。在編輯頁面或文章時,直接插入短碼到文章中,文章就會被列出來。基本的...。
  • Display Posts – Easy lists, grids, navigation, and more 》Display Posts 讓您輕鬆地列出網站上的所有內容。首先在內容編輯器中新增此短碼,以列出最近的文章清單:, [display-posts], , 按類別篩選, 若只想顯示特定類...。
  • CMS Tree Page View 》將所有頁面和自訂文章以 CMS 樹狀概覽方式添加到 WordPress,類似於專注於頁面的 CMS 中經常找到的檢視方式。, 如果您的目標是將多個內容類型合併到單一檢視...。
  • Category Posts Widget 》Category Posts Widget是一個輕巧的小工具,設計用於一件事並且做得很好:顯示特定類別中最新的文章。, 基於詞語和類別的文章小工具, 這個免費小工具的高級版...。
  • WP Telegram (Auto Post and Notifications) 》完美整合 Telegram 至 WordPress,讓您完全掌握控制。, Telegram 的卓越 LIVER 支援, 加入聊天室, 我們在 Telegram 上有一個公開小組,提供協助設置外掛、討...。
  • WP Admin UI Customize 》, 儀表板, 顯示選項標籤, 輸出 - 元網站, 管理工具列 (Toolbar), 側邊選單 (Side menu), 元箱的管理, 登入畫面, 其他功能, , 這些自訂化都是可以實現的。, , ...。
  • Ultimate Post Kit Addons for Elementor 》Ultimate Post Kit Elementor 外掛程式是首個允許您全新且清新地設計部落格網站的外掛程式。這是博客作者、行銷人員和文章類型網站擁有者的最佳工具。, Ultim...。
  • Reading Time WP 》WP Reading Time 讓你輕鬆地在 WordPress 文章中加入預估閱讀時間。啟用這個外掛會自動在你的文章內容的開始加入閱讀時間。你可以在「閱讀時間」設定中取消這...。

文章
Filter
Mastodon