[WordPress] 外掛分享: xili Post in Post

首頁外掛目錄 › xili Post in Post
WordPress 外掛 xili Post in Post 的封面圖片
60+
安裝啟用
★★★★
4.5/5 分(4 則評價)
2478 天前
最後更新
問題解決
WordPress 4.9+ v1.7.02 上架:2010-11-13

內容簡介

xili-postinpost 提供了一個三合一的工具包,在網頁的任何地方(WP 迴圈的內外)插入文章。所顯示的文章是由查詢(參見代碼)產生的,就像 WP 迴圈中的查詢一樣,但不會干擾主要的 WP 迴圈。Widget 包含有條件語法。

Template tag 函數 xi_postinpost() - 見原始碼,
像 [xilipostinpost query="p=1"] 或 <blockquote>[xilipostinpost query="cat=3,4,150&showposts=2&lang=en_us"]</blockquote> 的短碼(shortcode)。

帶有參數lang設置為cur的短碼,像 <blockquote>[xilipostinpost query="cat=3,4,150&showposts=2" lang="cur"]</blockquote> 將根據當前語言(例如:在未定義的頁面中顯示,根據瀏覽器語言顯示)。

和使用查詢結果上下文顯示的功能強大的 Widget。

此外,開發人員、作者和網站管理員均可使用。

在 Widget(和 template tag)中,如果設置了選項,可以選擇顯示期限和過期日期。

在 Widget 中(如果啟用了xili-language 插件),可以使用像 [query="cat=14" lang="cur"] 的參數,用方括號[]和 lang 設置為 cur 來組合查詢和當前語言。不要將 cur 放在查詢中。詳見屏幕截圖。

對於返回的結果列表中的每篇文章,顯示的結果都可以高度自定義,可以包含標題、摘要、內容、縮略圖像和帶或不帶指向單篇文章的鏈接。

即使在文章列表中使用了短碼,分頁也會被保留。

1.7.02版新增:

最後更新日期:2019-05-20
見變更日誌中的標籤和章節

更多信息

在 WP 單站和多站測試通過。

為什麼使用這個外掛?

xili-postinpost 是在最少的 PHP 編程 下(但不是所有人都可以理解),與終端用戶工具(如 widget)之間的折衷方案 - 但在背景中有大量 php 代碼 - 為CMS的網站管理員和數據設計師提供靈活性。插件的核心函數( xi_postinpost() )及其豐富的引數(有很多參數的數組)是四年前創建的,旨在將最新的新聞插入到標題中,將目標文章插入到頁面或文章的內容中的blockquote內。公開版本就像完成一本書一樣。請注意,免費的代碼不是免費的,引用用於商業用途或客戶的費用並捐贈。對於免費使用,請發送電子郵件!

Widget 中的查詢是否遞歸?

否,只有在第一個查詢為 false 的情況下才能組合一個真查詢和另一個查詢:語法是 [condition=… query=…]:[query=…]。第二部分可以像屏幕截圖6中那樣有自己的條件。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.7.02) 或搜尋安裝

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

原文外掛簡介

xili-postinpost provides a triple toolkit to insert post(s) everywhere in webpage – outside or inside WP loop – . The displayed post(s) are resulting of queries (see codex) like those in WP loop but not interfere with main WP loop. Widget contains conditional syntax.

Template tag function xi_postinpost() – see source ,
shortcode like [xilipostinpost query="p=1"] or like

[xilipostinpost query="cat=3,4,150&showposts=2&lang=en_us"]

.

A shortcode like

[xilipostinpost query="cat=3,4,150&showposts=2" lang="cur"]

with param lang set to cur give a result according the current language (example: inside an undefined page displayed according browser language).

and widget with powerful syntax for contextual display of query’s result.

are available for developers, authors and webmasters.
In widget (and template tag), if option is set, it is possible to choose display period and expiration date.
In widget – if xili-language plugin active – to combine a query and the current language use params like [query="cat=14" lang="cur"] with square bracket[] and lang set cur. Don’t put cur in query. See screenshot.
For each post of the resulting list, the displayed result is hightly customizable and can contain title, excerpt, content, thumbnail image with or without link to the post as single.
Paging is preserved even if a shortcode is used in a list of posts.
New with 1.7.02 :

Last Updated 2019-05-20
see tab and chapters in changelog

More infos

Tested on WP mono and multisite mode.

Why this plugin ?
xili-postinpost is compromise between minimum php coding (but not accessible by everybody) and end-user tool (like widget) – but with lot of php lines in background – to afford flexibility for webmaster and data-designer for CMS. The core function of the plugin ( xi_postinpost() ) and its rich argument (array with lot params) was created 4 years ago to insert by example a recent news in header, a target post inside blockquote set in content of a page or a post. Doing a public version is like finishing a book. Remind that free code is not gratis, include fees in quotation for commercial use or clients and donate. For free use, send an email!
Are the queries recursive in widget ?
No, it is only possible to combine one true and another one if the first is false: the syntax is [condition=… query=…]:[query=…]. The second part can have is own condition as in screenshot 6.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon