前言介紹
- 這款 WordPress 外掛「Query Shortcode」是 2013-01-14 上架。
- 目前有 30 個安裝啟用數。
- 上一次更新是 2013-04-27,距離現在已有 4394 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.3 以上版本才可以安裝。
- 有 5 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
shazdeh |
外掛標籤
內容簡介
這個外掛提供了 [query] 短碼,使你可以輸出按照特定條件篩選的文章。你可以自定義輸出格式,甚至可以在可定制的列和行網格中顯示結果。
還支援“鏡頭”(lenses),可以將查詢結果轉換成選項卡、手風琴或者輪播小工具。這個功能需要 Bootstrap 库已經在頁面上載入,在插件中並未包含。(如果需要,可以使用Bootstrap plugin)你可以在主題中創建新的鏡頭或覆蓋內置的鏡頭,以自定義輸出。
用法
你可以使用所有由WP_Query class支援的參數來篩選文章。你可以查詢特定的文章類型、分類、標籤、作者,等等。同時你需要定義你如何格式化輸出:
[query posts_per_page=”5″ cat=”3″]
{TITLE} ({COMMENT_COUNT})
[/query]
上述短碼將顯示最新的 5 個來自 ID 為 3 的分類的文章標題。可用的關鍵字包括:TITLE、CONTENT、AUTHOR、AUTHOR_URL、DATE、THUMBNAIL、CONTENT、COMMENT_COUNT等,將來還會添加更多選項。
網格顯示
使用“cols”參數可以在網格中顯示輸出。因此,這個短碼:
[query posts_per_page=”3″ cols=”3″] {THUMBNAIL}
{TITLE}
{CONTENT} [/query]
將在 3 列中使用指定模板顯示最新的 3 篇文章。如果在上面的片段中將帖子每頁顯示的選項設置為 6,它將顯示最新的 6 篇文章,每行有 3 列。
鏡頭
使用“lens”參數,可以在選項卡、手風琴或輪播小工具中顯示查詢結果。例如:
[query posts_per_page=”0″ post_type=”faq” lens=”accordion”]
這將為“faq”文章類型的所有文章創建手風琴小工具。這將創建一個最新的並且帶有五個特色文章的輪播小工具:
[query posts_per_page=”5″ featured=”true” lens=”carousel”]
支援的其他參數
除了 WP_Query 參數之外,此短碼還支援其他參數:
featured: 查詢置頂文章,默認情況下這些文章被排除在查詢之外。
thumbnail_size: 指定 {THUMBNAIL} 圖像的大小。你可以使用內置的圖像大小或自定義的大小。
content_limit: 限制 {CONTENT} 變數的字數;默認為“0”,表示輸出全部內容。
posts_separator: 用於在各個文章之間顯示的文字。
原文外掛簡介
This plugin gives you [query] shortcode which enables you to output posts filtered by specific attributes. You can format the output to your liking and even display the results in a grid of customizable columns and rows.
Also supports “lenses” which can turn your query results into Tabs, Accordion, or Carousel widgets. This feature relies on Bootstrap library to be already loaded on the page, the plugin does not include it (for that you can use the Bootstrap plugin). You can create new lenses or override the built-in ones in your theme to customize the output.
Usage
You can use all parameters supported by WP_Query class to filter the posts; you can query for specific post types, categories, tags, authors, etc. You also have to define how you want to format the output:
[query posts_per_page=”5″ cat=”3″]
{TITLE} ({COMMENT_COUNT})
[/query]
The above shortcode will display the title of the latest 5 posts from the category with the ID of 3. Available keywords are: TITLE, CONTENT, AUTHOR, AUTHOR_URL, DATE, THUMBNAIL, CONTENT, COMMENT_COUNT and more to be added later.
Grid display
With the “cols” parameter you can display the output in a grid. So this:
[query posts_per_page=”3″ cols=”3″] {THUMBNAIL}
{TITLE}
{CONTENT} [/query]
will display the latest 3 posts in the defined template, in 3 columns. If in the above snippet we set the posts_per_page option to 6, it will display the latest 6 posts in two rows that each has 3 columns.
Lenses
With the “lens” parameter you can display the query results in a Tab, Accordion, or Carousel widget. Example:
[query posts_per_page=”0″ post_type=”faq” lens=”accordion”]
This will create an accordion widget of all our posts from the “faq” post type. This creates a carousel of latest five featured posts:
[query posts_per_page=”5″ featured=”true” lens=”carousel”]
Other supported parameters
Aside from wp_query parameters, the shortcode also supports additional parameters:
featured : to query for sticky posts which by default are excluded from the query.
thumbnail_size : to specify the size of the {THUMBNAIL} images. You can use built-in image sizes or custom ones you’ve defined.
content_limit : to limit the number of words of the {CONTENT} var; by default it’s “0” which means it outputs the whole content.
posts_separator : text to display between individual posts.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Query Shortcode」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
PS Auto Sitemap 》PS Auto Sitemap 是一個 WordPress 外掛,自動從您的 WordPress 網站生成網站地圖頁面。, 對於初學者來說,安裝非常容易;對於專家來說,定制也非常容易。您...。
Post Type Switcher 》這個外掛在文章編輯介面中新增了一個簡單的文章型別下拉選單,讓你可以重新指派任何文章至新的文章型別。你可以在編輯文章時更換文章的型別。, 支援的型別, ...。
Post Duplicator 》這個外掛是用來製作選定文章的完全一模一樣複製。它支援自訂文章類型、自訂分類和自訂欄位。, *注意: 評論不會被複製到新文章。, 這個外掛的目的是為了快速且...。
Optimize Database after Deleting Revisions 》這個外掛是一個「一鍵式」WordPress資料庫清理/優化器。, 主要功能, , 刪除文章、頁面和/或自訂文章類型的修訂版本(您可以選擇保留最近的「X」個修訂版本,...。
Advanced Excerpt 》這個外掛可以改進 WordPress 原有的摘錄文章功能。, , 保留摘錄中的 HTML 標記,並可自選需要保留的標記, 按字元數或字數截斷摘錄, 只計算「真正的」文字(HT...。
Add From Server 》這個外掛提供有限的支援。請不要期望有太多新功能或修正 bug。功能可能隨時被移除。, Add From Server 外掛旨在幫助緩解不好的網站主機所造成的困擾,讓您可...。
Page and Post Clone 》這個外掛可以透過一個按鈕來複製貼文或頁面,現在您不必從零開始進行新頁面或貼文的樣式設計。, 這個外掛的主要功能包括:, , 建立一個頁面複本,保留所有內...。
WP Page Widget 》這款外掛讓小工具的選擇變得更加容易。啟用此外掛後,我們可以選擇要顯示在特定頁面/文章/自訂文章類型中的小工具。, 請注意,使用此外掛時必須啟用側邊欄主題。。
WP Total Hacks 》WP Total Hacks 可以在您的 WordPress 網站上自訂超過 20 個設置。, 此外掛已在 GitHub 上發布。, 一些功能:, 您可以選擇啟用或停用所有項目。, 需要 PHP5!...。
Revision Control 》**本外掛不提供支援。仍可使用,但請勿期待得到支援要求的回應或對「這無法運作」進行回應。**, Revision Control 是 WordPress 的一款外掛,可以讓使用者更...。
Reveal IDs 》WordPress 2.5版本發佈後,所有管理頁面的ID都被刪除了。這應該是因為普通用戶不需要它們。但對於高級WordPress用戶和開發人員來說,這些ID對某些外掛或模板...。
Bulk Delete 》Bulk Delete 是一個 WordPress 外掛,可以根據不同的條件和過濾器批次刪除文章、頁面、附件、使用者和元資料。此外掛支援以下條件和過濾器:, , 刪除文章, , ...。
WP Admin UI Customize 》, 儀表板, 顯示選項標籤, 輸出 - 元網站, 管理工具列 (Toolbar), 側邊選單 (Side menu), 元箱的管理, 登入畫面, 其他功能, , 這些自訂化都是可以實現的。, , ...。
Themify Portfolio Post 》Themify Portfolio Posts 是一個簡單的外掛,允許您展示乾淨版面的專案資訊。簡約而精美,您可以點擊您的圖庫專案的每張圖片,選擇顯示更多細節,例如專案類...。
Essential Content Types 》Essential Content Types 是一個 WordPress 外掛程式,讓您可以在您的網站上以不同的內容/文章類型展示出優秀的內容。這些內容/文章類型可能會被 WordPress ...。