前言介紹
- 這款 WordPress 外掛「Loop Post Navigation Links」是 2009-07-22 上架。
- 目前有 700 個安裝啟用數。
- 上一次更新是 2020-08-27,距離現在已有 1711 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.9 以上版本才可以安裝。
- 有 12 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
next | links | posts | previous | navigation |
內容簡介
此外掛提供兩個範本標籤,可在 single.php 中使用,創建文章導覽迴圈。在第一篇文章前面出現最後一篇文章,在最後一篇文章後面出現第一篇文章。基本上,當您在最後一篇文章中,並且點擊下一篇文章時,鏈接將帶您到第一篇文章。同樣地,如果您在第一篇文章上並點擊上一篇文章,鏈接會帶您回到最後一篇文章。
函數 c2c_next_or_loop_post_link() 在每種方式上都與 WordPress 的 next_post_link() 相同,除了在導覽序列中的最後一篇文章上調用時,它會連結回導覽序列中的第一篇文章。
函數 c2c_previous_or_loop_post_link() 在每種方式上都與 WordPress 的 previous_post_link() 相同,除了在導覽序列中的第一篇文章上調用時,它會連結回導覽序列中的最後一篇文章。
可用於提供文章的循環連結,例如作品集,或繼續為訪客呈現相關文章。
如果您有興趣獲取文章本身而不僅僅是文章的連結,則可以使用 c2c_get_next_or_loop_post() 和 c2c_get_previous_or_loop_post() 函數。如果只想在文章上獲取 URL,則可以使用 c2c_get_next_or_loop_post_url() 和 c2c_get_previous_or_loop_post_url()。
鏈接:插件主頁 | 插件目錄頁 | GitHub | 作者主頁
範本標籤
此外掛提供四個範本標籤,可在您的單一文章主題範本上使用。
函數
- 函數 c2c_next_or_loop_post_link( $format='%link »', $link='%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
像 WordPress 的 next_post_link() 一樣,此函數顯示到下一篇文章的鏈接(在所有已發布的文章中、在相同類別中的文章或不在某些類別中的文章中)。不像 next_post_link(),當在序列中的最後一篇文章上時,此函數會連結回序列中的第一篇文章,創建一個循環。
- 函數 c2c_get_next_or_loop_post_link( $format='%link »', $link='%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
像 c2c_next_or_loop_post_link(),但返回該值而不回應它。
- 函數 c2c_previous_or_loop_post_link( $format='« %link', $link='%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
像 WordPress 的 previous_post_link() 一樣,此函數顯示到上一篇文章的鏈接(在所有已發布的文章中、在相同類別中的文章或不在某些類別中的文章中)。不像 previous_post_link(),當在序列中的第一篇文章上時,此函數將連結到序列中的最後一篇文章,創建一個循環。
- 函數 c2c_get_previous_or_loop_post_link( $format='« %link', $link='%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
像 c2c_get_previous_or_loop_post_link(),但返回該值而不回應它。
- 函數 c2c_get_next_or_loop_post( $in_same_term = false, $excluded_terms = '',
原文外掛簡介
This plugin provides two template tags for use in single.php to create a post navigation loop, whereby previous to the first post is the last post, and after the last post is first post. Basically, when you’re on the last post and you click to go to the next post, the link takes you to the first post. Likewise, if you’re on the first post and click to go to the previous post, the link takes you to the last post.
The function c2c_next_or_loop_post_link() is identical to WordPress’s next_post_link() in every way except when called on the last post in the navigation sequence, in which case it links back to the first post in the navigation sequence.
The function c2c_previous_or_loop_post_link() is identical to WordPress’s previous_post_link() in every way except when called on the first post in the navigation sequence, in which case it links back to the last post in the navigation sequence.
Useful for providing a looping link of posts, such as for a portfolio, or to continually present pertinent posts for visitors to continue reading.
If you are interested in getting the post itself and not just a link to the post, you can use the c2c_get_next_or_loop_post() and c2c_get_previous_or_loop_post() functions. If you just want the URL to the post, you can use c2c_get_next_or_loop_post_url() and c2c_get_previous_or_loop_post_url().
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Template Tags
The plugin provides four template tags for use in your single-post theme templates.
Functions
function c2c_next_or_loop_post_link( $format='%link »', $link='%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
Like WordPress’s next_post_link(), this function displays a link to the next chronological post (among all published posts, those in the same category, or those not in certain categories). Unlink next_post_link(), when on the last post in the sequence this function will link back to the first post in the sequence, creating a circular loop.
function c2c_get_next_or_loop_post_link( $format='%link »', $link='%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
Like `c2c_next_or_loop_post_link(), but returns the value without echoing it.
function c2c_previous_or_loop_post_link( $format='« %link', $link='%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
Like WordPress’s previous_post_link(), this function displays a link to the previous chronological post (among all published posts, those in the same category, or those not in certain categories). Unlink previous_post_link(), when on the first post in the sequence this function will link to the last post in the sequence, creating a circular loop.
function c2c_get_previous_or_loop_post_link( $format='« %link', $link='%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
Like `c2c_get_previous_or_loop_post_link(), but returns the value without echoing it.
function c2c_get_next_or_loop_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
Like WordPress’s get_adjacent_post() when used to find the next post, except when on the last post in the sequence this function will return the first post in the sequence, creating a circular loop.
function c2c_get_previous_or_loop_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
Like WordPress’s get_adjacent_post() when used to find the previous post, except when on the first post in the sequence this function will return the last post in the sequence, creating a circular loop.
function c2c_get_next_or_loop_post_url( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
Returns the URL for the next post or the post at the beginning of the series.
function c2c_get_previous_or_loop_post_url( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )
Returns the URL for the previous post or the post at the end of the series.
Arguments
$format
(optional) A percent-substitution string indicating the format of the entire output string. Use %link to represent the next/previous post being linked, or %title to represent the title of the next/previous post.
$link
(optional) A percent-substitution string indicating the format of the link itself that gets created for the next/previous post. Use %link to represent the next/previous post being linked, or %title to represent the title of the next/previous post.
$in_same_term
(optional) A boolean value (either true or false) indicating if the next/previous post should be in the current post’s same taxonomy term.
$excluded_terms
(optional) An array or comma-separated string of category or term IDs to which posts cannot belong.
$taxonomy
(optional) Taxonomy, if $in_same_term is true. Default ‘category’.
Examples
Hooks
The plugin is further customizable via eleven hooks. Typically, code making use of hooks should ideally be put into a mu-plugin, a site-specific plugin (which is beyond the scope of this readme to explain), or in theme template files. Many of these filters are likely only of interest to advanced users able to code.
c2c_previous_or_loop_post_link_output, c2c_next_or_loop_post_link_output (filters)
The ‘c2c_previous_or_loop_post_link_output’ and ‘c2c_next_or_loop_post_link_output’ filters allow you to customize the link markup generated for previous and next looping links, respectively.
Arguments:
$format (string): Link anchor format.
$link (string): Link permalink format.
$in_same_term (bool): Optional. Whether link should be in a same taxonomy term. Default is false.
$excluded_terms (array|string): Optional. Array or comma-separated list of excluded term IDs. Default is ”.
$previous (bool): Optional. Whether to display link to previous or next post. Default is true.
$taxonomy (string): Optional. Taxonomy, if $in_same_term is true. Default ‘category’.
$adjacent (string): Whether the post is previous or next.
Example:
c2c_previous_or_loop_post_link_get, c2c_next_or_loop_post_link_get (filters)
The ‘c2c_previous_or_loop_post_link_get’ and ‘c2c_next_or_loop_post_link_get’ filters allow you to customize the link markups generated for previous and next looping links, respectively, but in the non-echoing functions.
Arguments:
$output (string): The adjacent post link.
$format (string): Link anchor format.
$link (string): Link permalink format.
$post (WP_Post): The adjacent post.
$in_same_term (bool): Optional. Whether link should be in a same taxonomy term. Default is false.
$excluded_terms (array|string): Optional. Array or comma-separated list of excluded term IDs. Default is ”.
$previous (bool): Optional. Whether to display link to previous or next post. Default is true.
$taxonomy (string): Optional. Taxonomy, if $in_same_term is true. Default ‘category’.
$adjacent (string): Whether the post is previous or next.
c2c_previous_or_loop_post_link, c2c_next_or_loop_post_link, c2c_get_previous_or_loop_post_link, c2c_get_next_or_loop_post_link, c2c_get_adjacent_or_loop_post, c2c_get_previous_or_loop_post, c2c_get_previous_or_loop_post (actions)
The ‘c2c_previous_or_loop_post_link’ and ‘c2c_next_or_loop_post_link’ actions allow you to use an alternative approach to safely invoke c2c_previous_or_loop_post_link() and c2c_next_or_loop_post_link(), respectively, in such a way that if the plugin were deactivated or deleted, then your calls to the functions won’t cause errors in your site. The ‘c2c_get_previous_or_loop_post_link’ and ‘c2c_get_next_or_loop_post_link’ filters do the same for the non-echoing c2c_previous_or_loop_post_link() and c2c_next_or_loop_post_link().
Arguments:
Same as for for c2c_previous_or_loop_post_link() and c2c_next_or_loop_post_link()
Example:
Instead of:
« %link' ); ?>
Do:
« %link' ); ?>
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Loop Post Navigation Links」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 1.5 | 1.6 | 2.0 | 2.5 | 2.6 | 3.0 | 1.6.1 | 1.6.2 | 1.6.3 | 2.5.1 | 2.5.2 | 2.6.1 | 3.0.1 | 3.0.2 | trunk |
延伸相關外掛(你可能也想知道)
Admin Post Navigation 》此外掛為「Edit Post」管理頁面新增「← 前一篇」和「下一篇 →」連結,如果有前一篇和下一篇文章時,會顯示相對應的連結標題(游標懸停連結上會顯示...。
Ambrosite Next/Previous Post Link Plus 》重要提示:請確保使用正確的外掛程式。, , Next/Previous Post Link Plus 外掛程式適用於單篇文章模板。, Next/Previous Page Link Plus 外掛程式適用於頁面...。
Cresta Posts Box 》外掛首頁和演示, 使用 Cresta Posts Box 外掛,您可以在一個頁面上(文章、頁面或自訂文章類型中),顯示一個小框,讓讀者前往下一篇或上一篇文章。該框只出...。
Ambrosite Next/Previous Page Link Plus 》重要提示:請確認您使用的是正確的外掛程式。, , Next/Previous Page Link Plus 是用於頁面樣板的。, Next/Previous Post Link Plus 是用於單篇文章樣板的。,...。
Smarter Navigation 》當顯示單一文章時,您可能想在相同分類中顯示鏈結至上一篇和下一篇文章。, 那很好;WordPress 讓你透過 previous_post_link() 和 next_post_link() 完成此操...。
Next and Previous Buttons 》這個外掛會在所有頁面、文章和產品上添加“前一頁”和“下一頁”按鈕。這些按鈕讓您快速輕鬆地瀏覽站點內容。您可以選擇在 WordPress 編輯器中顯示上一頁/下一頁...。
WP Single Post Navigation Within Category 》這個外掛會在單獨的文章中增加導覽連結,以連接到目前類別中的前一篇或後一篇文章。。
Linchpin – PrevNextPage 》創建頁面的上一頁/下一頁連結。添加 next_page_link() 和 previous_page_link() 函數,用於鏈接兄弟頁面。, 如果您的頁面沒有直接的兄弟頁面,該外掛將嘗試跳...。
Unlimited 》無限滾動外掛。可從「捲動載入」、「載入更多按鈕」和「Ajax 分頁」中選擇。訪客可停用自動載入功能(有助於到頁腳)。, 不會影響瀏覽器的「回上頁/回下頁」...。
Superslider-PreviousNext-Thumbs 》-previousnext-thumbs 插件是一個用於上一篇和下一篇文章及縮略圖導航建立的 WordPress 外掛程式,專門用於單篇文章頁面。可以透過 CSS 控制動畫的滑鼠經過效...。
Retain Author 》Retain Author 可以讓您強制要求您的「下一篇」和「上一篇」博客文章保持在同一類別和同一作者中。。
Next / Previous Product for Woocommerce FREE version 》這個免費的外掛在同一個商品類別中的單一商品頁面中顯示下一個和上一個商品。, 安裝, 只需將.zip檔案上傳到WordPress中,然後啟用該外掛。一個名為“Next/Prev...。
Intuitive Navigation 》此外掛可依據訪客所來自的類別或標籤建立導覽列,使網頁轉換至上一篇或下一篇相關文章。您可以自行嵌入導覽列,或使用自定函數addIntNav()於您的樣板檔案。搭...。
Pixie Dust 》Pixie Dust 外掛會把網站訪客在前往登入頁面前所瀏覽的頁面建立重新導向功能;, 如果訪客是在查看物品、圖片集或文章,登入後會被重新導向回該頁面。, 如果重...。
Page navigation by menu 》此外掛可提供頁面導覽功能,類似於內建函式 the_posts_navigation() 用於文章的功能。, 導覽的頁面會依照所提供的選單篩選(預設為主選單)及與選單項目相同...。