前言介紹
- 這款 WordPress 外掛「Ajax Pagination and Infinite Scroll」是 2015-09-08 上架。 目前已經下架不再更新,不建議安裝使用。
- 目前有 3000 個安裝啟用數。
- 上一次更新是 2017-02-02,距離現在已有 3012 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.6.0 以上版本才可以安裝。
- 有 27 人給過評分。
- 論壇上目前有 1 個提問,問題解答率 0%
外掛協作開發者
外掛標籤
ajax | back | admin | ajax pagination | custom post types |
內容簡介
這個外掛可在整個 WordPress 網站上使用 Ajax 載入分頁內容。該外掛可在文章、頁面、搜尋、自訂文章類型和 WooCommerce 上運作。在同一範本中分頁多組文章。
請參考演示網站。
我們正在尋找使用此外掛的網站,以展示在我們的展示頁面中。如果您有興趣,請將您網站的連結發送到[email protected]。
這個外掛有三種分頁類型可供選擇。
無限滾動 - 當使用者滾動到螢幕底部時自動載入新文章。
載入更多按鈕 - 點擊以載入新文章。
分頁 - 正常的分頁,但是使用 Ajax 載入下一頁。
設定方式
若需更多協助,請參考這個影片。
一旦安裝此外掛,請前往設定 -> Ajax 分頁設定。
選擇一個適用的主題默認值。如果您的主題不在列表中,請新增正確的選擇器。
需要使用您的瀏覽器開發人員工具找到 4 個必要的選擇器。
'文章選擇器' - 包含所有文章/商品的選取器。
'文章選項' - 單個文章/商品的選取器。
'導覽選擇器' - 文章/商品導覽的選取器。
'下一步選擇器' - 導覽下一個鏈接的選取器。
選擇其中一個分頁類型。
添加可選的回調函數。
點擊 '保存更改'。
多個設定值
例如,如果您的網站同時運作 WooCommerce 和部落格,那麼這兩種模板可能會使用不同的選擇器,需要從管理設置進行不同的設置。
在螢幕頂部點擊 '新增'。
重複上面的設定步驟並點擊 '保存更改'。
在螢幕頂部,您可以在保存的設置之間進行導覽。
多組文章設定
可將多組文章查詢和顯示在同一範本中,並獨立分頁。需要在範本文件中進行特定的設置,此已在這裡中簡要介紹。
刪除設置
在螢幕頂部選擇要刪除的分頁設置。
向下滾動螢幕,然後點擊 '刪除'。
樣式設計 - 載入更多按鈕
載入更多按鈕被包裝在一個具有 CSS 類別名 .malinky-load-more 的 div 中,該按鈕具有 CSS 類別名 .malinky-load-more__button。
在您的主題 style.css 文件中設計這些。
初始化(設置)
當頁面首次加載時,該外掛會初始化,然後更新分頁使用 Ajax。如果您需要隨時重新初始化該外掛,請在您的 JavaScript 中調用以下函數。
MalinkyAjaxPaging.setUp();
如果您在電子商務網站上運行任何其他 JavaScript/Ajax,例如篩選,那麼這是有用的。
回調函式
在每次載入新的文章集之後在設定中添加您自己的 JavaScript 代碼。
回調函數接收兩個參數:loadedPosts(一個新文章的數組)和 url(加載的 URL)。
原文外掛簡介
Load paged content with Ajax throughout your WordPress site. The plugin works on posts, pages, search, custom post types and WooCommerce. Paginate MULTIPLE sets of posts in the same template.
Take a look at the demo site.
We’re looking for websites that use the plugin to feature on a showcase page. If you’re interested please email a link to your website to [email protected].
There are 3 pagination types to choose from.
Infinite Scroll – Automatically load new posts when the user reaches the bottom of the screen.
Load More Button – Click to load new posts.
Pagination – Normal pagination but load the next page with Ajax.
Set Up
For additional help watch this video.
Once the plugin is installed navigate to Settings -> Ajax Pagination Settings.
Select an applicable theme default. If your theme isn’t listed then add the correct selectors.
There are 4 required selectors which can be found by using your browser developer tools.
‘Posts Selector’ The selector that wraps all of the posts/products.
‘Post Selector’ The selector of an individual post/product.
‘Navigation Selector’ The selector of the post/product navigation.
‘Next Selector’ The selector of the navigation next link.
Choose a pagination type.
Add an optional callback.
Click ‘Save Changes’.
Multiple Settings
If for example your site is running WooCommerce and also a Blog then the two templates will probably use different selectors and require a different set up from the admin settings.
Click ‘Add New’ at the top of the screen.
Repeat the set up steps above and click ‘Save Changes’.
At the top of the screen you can navigate between your saved settings.
Multiple Sets of Posts
It’s possible to query and display multiple sets of posts in the same template and independently paginate them. This requires a specific set up within the template file which has been outlined here.
Delete Setting
At the top of the screen select the pagination setting you wish to delete.
Scroll to the bottom of the screen and click ‘Delete’.
Styling Load More Button
The load more button is wrapped in a div with the css class .malinky-load-more and the button has the css class .malinky-load-more__button.
Style these in your themes style.css file.
Initialization (Setup)
The plugin is initialized when the page first loads and the pagination is then updated to use Ajax. If you need to reinitialize the plugin at anytime call the folowing function in your javascript.
MalinkyAjaxPaging.setUp();
This is useful if you run any other javascript / ajax on the page, for example filtering on an ecommerce site.
Callback
Add your own Javascript code in the settings which runs after each new set of posts are loaded.
Callback receives two parameters: loadedPosts (An array of the new posts) and url (The url that was loaded).
Custom Events
There are 3 custom events that are triggered. Bind to these events to perform your own actions.
malinkyPaginationInitialized. Triggered after initialization.
document.addEventListener('malinkyPaginationInitialized', function(e) {
console.log('PaginationInitialized');
});
malinkyLoadPostsStart. Triggered before new posts are loaded.
document.addEventListener('malinkyLoadPostsStart', function(e) {
console.log('LoadPostsStart');
});
malinkyLoadPostsComplete. Triggered after new posts are loaded.
document.addEventListener('malinkyLoadPostsComplete', function(e) {
console.log('LoadPostsComplete');
});
Events only function when using a single set of pagination on a page.
Isotope / Masonry
If your using an isotope / masonry layout then you’ll need to add a callback in the settings to layout the new posts when they are added. This should be in the following format.
$('.grid').isotope('reloadItems').isotope();
Change the reference to the class name .grid to your own container element.
Additional
If using infinite scroll there is an option to amend the buffer in pixels before the next set of posts are loaded.
If using load more button there is an option to amend the button text.
You can choose your own preloader.gif.
When using pagination the browser history is maintained allowing your visitors to use the browser back and forward buttons as expected.
Conditional Loading
By default the plugin loads on every page load. You can stop loading the Javascript and CSS by setting the following constants to false in your wp-config.php file.
define('MALINKY_LOAD_JS', false);
define('MALINKY_LOAD_CSS', false);
Or by adding these two lines to your functions.php
add_filter( 'malinky_load_js', '__return_false' );
add_filter( 'malinky_load_css', '__return_false' );
Once disabled you can load the Javascript and CSS in specific templates by adding the following before the wp_head().
global $malinky_ajax_pagination;
$malinky_ajax_pagination->malinky_ajax_pagination_styles();
$malinky_ajax_pagination->malinky_ajax_pagination_scripts();
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Ajax Pagination and Infinite Scroll」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0.0 | 1.1.0 | 1.1.1 | 1.2.0 | 1.2.1 | 1.3.0 | 2.0.0 |
延伸相關外掛(你可能也想知道)
Load More Products for WooCommerce 》透過 AJAX 以無限滾動方式或載入更多產品按鈕,從下一頁載入產品, 功能:, ✅ WooCommerce 產品的無限滾動, ✅ 載入更多產品按鈕或 AJAX 分頁, ...。
YITH Infinite Scrolling 》他們想要立即滿足需求!, 現在大家習慣於順序地在線上瀏覽內容:Facebook 或 Twitter,它們的導覽系統影響了我們瀏覽網頁的方式。因此,使用 YITH Infinite S...。
Load More Anything 》Commerce Products, Custom Div or Anything, , 這款插件能幫助您在 WordPress 網站上載入更多內容。您可以在博客文章、評論、頁面、類別、最新文章、側邊欄...。
Post Grid Master – Custom Post Types, Taxonomies & Ajax Filter Everything with Infinite Scroll, Load More, Pagination & Shortcode Builder 》「Post Grid Ajax外掛」是一款簡單、乾淨、易於使用的WordPress外掛程式,可協助您透過Ajax按分類條件篩選文章,還包括無限滾動功能。使用這個Ajax文章網格,...。
WP Ajax Load More Pagination and Infinite Scroll 》使用 Ajax 載入分頁內容,適用於標準 WordPress 分頁、WooCommerce 分頁、外掛等等。, 外掛展示, 特色, , Ajax 分頁;, 「載入更多」按鈕;, 「載入更多」按...。
Ultimate Infinite Scroll, AJAX Lazy load Plugin for Posts & Woocommerce 》這個「The Ultimate Infinite Scroll for Woocommerce」外掛程式可以用 Ajax 無限捲動來取代 Woocommerce 產品頁面的預設分頁功能。現在,使用者無需點擊分頁...。
LCP Ajax Pagination 》LCP Ajax Pagination 是一個 List Category Posts 的外掛插件。, 眾多使用者已要求 AJAX 分頁功能,現在此擴展套件已能實現。, 目前支援兩種模式:, , Ajax ...。
DMD Infinite Scroll 》這個外掛提供 AJAX 載入 WooCommerce 產品,並可用於任何其他文章。在同一個範本中分成最多 10 組文章進行分頁。, 可與任何有選項呼叫自訂 JavaScript 程式碼...。
CPTA Pagination 》這是一個簡單的自訂文章類型 AJAX 分頁外掛。, 功能:, , 容易自訂。, 輕量級。, 自訂文章類型 AJAX 分頁與分類。, 。
Infinite Scroll Product For WooCommerce 》總結:, 「無限捲動產品外掛 For WooCommerce」是一個WordPress外掛,可以將預設的商品分頁功能轉換為無限捲動或Ajax分頁,並搭配WooCommerce使用。, , 問題與...。
Simple Ajax Pagination 》簡單的Ajax分頁外掛可以透過強大的jQuery輕鬆安裝和設置,並將簡單的分頁創建為Ajax分頁。它還可以用於自定義文章類型和多語言網站。, 文檔和支援, 不需要任...。
WP Paging Ajax 》這是一個使用 AJAX 實現分頁功能的簡易外掛。目前版本僅支援整數分頁。該外掛與所有模板兼容,不會改變文章、產品(woocommerce)或任何文章類型的存檔介面...。
Filter Anything 》Filter Anything 提供了對於任何文章或使用者數據的進階過濾。您可以使用簡單的短代碼即可瞬間建立任何類型的目錄,並選擇不同的佈局選項。, 簡要來看,此外...。
Instant Infinite Loader 》總結:Instant Infinite Loader透過提供無限滾動功能或「載入更多」按鈕,使您的WordPress網站擁有流暢的用戶體驗。該強大的外掛還支持AJAX分頁和等離子體選...。
Unlimited 》無限滾動外掛。可從「捲動載入」、「載入更多按鈕」和「Ajax 分頁」中選擇。訪客可停用自動載入功能(有助於到頁腳)。, 不會影響瀏覽器的「回上頁/回下頁」...。