
內容簡介
這個 REST API 擴充外掛可以使 Ajax Load More 和 WP REST API 外掛之間相容。
輕鬆透過 HTTP REST API 存取您的網站資料(以 JSON 格式),再利用 Ajax Load More 的無限捲動功能美觀地顯示結果。
作法
REST API 擴充外掛透過將標準的 Ajax Load More admin-ajax.php 請求路由到 API 端點以取得資料。資料以 JSON 格式回傳,再使用 Underscore.js 樣式模板在網站前端進行解析並顯示。
使用簡單的 GET 請求、一個 JavaScript Repeater 模板和專為 Ajax Load More 開發的自訂端點 (/wp-json/ajaxloadmore/posts),使用者可以存取網站資料並使用 WP REST API 實現無限滾動。
查看範例
外掛標籤
開發者團隊
原文外掛簡介
The REST API extension will enable compatibility between Ajax Load More and the WP REST API plugin.
Easily access your website data (as JSON) through an HTTP REST API and display the results using the beauty of infinite scrolling with Ajax Load More.
How It Works
The REST API add-on works by routing the standard Ajax Load More admin-ajax.php requests through to API endpoints for data retrieval. The data is returned as JSON, then parsed and displayed using Underscore.js styled templates on the front-end of your website.
Using a simple GET request, a JavaScript Repeater Template and a custom endpoint (/wp-json/ajaxloadmore/posts) developed specifically for Ajax Load More, users are able to access website data and infinite scroll the results using the WP REST API.
View Example
