
內容簡介
LCP Ajax Pagination 是一個 List Category Posts 的外掛插件。
眾多使用者已要求 AJAX 分頁功能,現在此擴展套件已能實現。
目前支援兩種模式:
Ajax 分頁
載入更多文章
重要提示:需要 List Category Posts 版本 0.84.1 或更高版本。
Ajax 分頁
使用方式:[catlist ajax_pagination=yes]
結果和使用 [catlist pagination=yes] 相同,只是點擊分頁連結時不會觸發頁面重新加載。
新文章會異步提取,列表會在不重新加載頁面的情況下更新。
不會修改 LCP 分頁 的其他功能,
您仍然可以像以前一樣使用分頁 CSS 或其他自定義。
載入更多文章
使用方式:[catlist ajax_loadmore=yes]
這會通過用「載入更多」鏈接替換 LCP 分頁鏈接來轉換 LCP 分頁。請注意,此
首個版本不允許指定要提取多少文章,而是使用 numberposts 短碼參數
同 分頁LCP。
這在未來的版本中會改變。
您可以使用 LCP 的 pagination_next 參數自定義鏈接文字:
[catlist ajax_loadmore=yes pagination_next=”顯示更多文章”]
一般注意事項
重要提示:如果頁面中有多個短碼,那些使用 AJAX 的必須設定 instance 參數,
詳見文檔。
例如:[catlist ajax_loadmore=yes instance=1]
您不必使用 LCP 的 pagination 參數,使用 ajax_loadmore 或 ajax_pagination 即可。
請確保您的短碼中僅包含一個選項: ajax_loadmore 或 ajax_pagination,否則插件將無法正常運作。
CSS 自定義
此插件使用以下 CSS 類:
AJAX 分頁的 <ul> 具有原始的 lcp_paginator 類,此插件還添加了 lcpax-pagination。
「載入更多」鏈接周圍的包裝器為:<div class="lcpax-nextlink-wrapper">,鏈接本身保留不變,
與 LCP 一樣,具有 lcp_nextlink 類。
等待「載入更多」完成時顯示的 SVG 旋轉器具有 lcpax-spinner 類。
開發
LCP Ajax 是開源軟體。您可以在 Github 找到
插件的開發版本。
我們歡迎所有建議和貢獻。複製代碼,閱讀存儲庫的
readme,開始幫助開發吧!
支持此插件
如果您發現此插件有用並希望支持其進一步發展,請考慮
在 GitHub 上贊助或 在 PayPal 上捐贈 🙂
使用者支援
如有疑問,請使用支援論壇。
外掛標籤
開發者團隊
原文外掛簡介
LCP Ajax Pagination is an add-on plugin for List Category Posts.
Many users have requested the AJAX pagination feature and it is now possible with this extension.
Two modes are currently supported:
Ajax pagination
Load more posts
IMPORTANT: Requires List Category Posts version 0.84.1 or greater.
Ajax pagination
Usage: [catlist ajax_pagination=yes]
The result is as if you used [catlist pagination=yes] but clicking pagination links does not trigger page reloads.
Instead, new posts are fetched asynchronously and the list is updated without a reload.
No other features of LCP pagination are modified,
you can apply your pagination CSS, or other customisations, same as you have before.
Load more
Usage: [catlist ajax_loadmore=yes]
This transforms vanilla LCP pagination by replacing pagination links with a “Load more” link. Note that this
first release does not allow specifying how many posts to fetch and uses the numberposts shortcode parameter
same as vanilla pagination.
This will change in a future release.
You can customise the link’s text using LCP’s pagination_next parameter:
[catlist ajax_loadmore=yes pagination_next=”Show more posts”]
General notes
IMPORTANT: If you have multiple shortcodes on a page, those using AJAX must have the instance parameter set
as per the documentation.
[catlist ajax_loadmore=yes instance=1]
You do not have to use LCP’s pagination parameter, using ajax_loadmore or ajax_pagination is enough.
Make sure your shortcode contains only one option: ajax_loadmore or ajax_pagination, otherwise the plugin will not work.
CSS customisations
The plugin uses the following CSS classes:
AJAX pagination
- has the original lcp_paginator class, this plugin also adds lcpax-pagination.
Wrapper around the load more link is:
as delivered by LCP, so it has the lcp_nextlink class.
The SVG spinner displayed while waiting for ‘load more’ to finish has the lcpax-spinner class.
Development
LCP Ajax is open source software. You can find the
development version of the plugin on Github.
All suggestions and contributions are welcome 🙂 Fork it, read the respository’s
readme and start helping with the development!
Support the plugin
If you have found this plugin useful and would like to support its further development please consider
sponsoring it on GitHub or donating on PayPal 🙂
User Support
Please use the support forum for questions about using the plugin. Use Github issues for discussing code changes and bugs.
