Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Robbertdk/WordPress-Ajax-load-more-posts
Plugin for WordPress. Loads the next posts page via Ajax.
https://github.com/Robbertdk/WordPress-Ajax-load-more-posts
Last synced: about 2 months ago
JSON representation
Plugin for WordPress. Loads the next posts page via Ajax.
- Host: GitHub
- URL: https://github.com/Robbertdk/WordPress-Ajax-load-more-posts
- Owner: Robbertdk
- License: gpl-2.0
- Created: 2017-06-19T17:43:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-21T09:58:26.000Z (over 7 years ago)
- Last Synced: 2024-07-31T01:46:32.110Z (about 2 months ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# WordPress Ajax load more posts
## Description
A WordPress plugin to load more posts via ajax.
- This plugin overwrites the `get_the_posts_navigation` function. So you don't need any shortcodes.
- This plugins uses no dependencies, is translatable and WPML ready.
- The default previous and next links that are generated via `get_the_posts_navigation` keep available for visitors with JavaScript disabled.This plugin just grabs the next page url, makes an Ajax request to that url and parses it. Therefore you don't need to worry if your theme templates and functionality gets used. What works for a browser request, works for the ajax request. The new posts get inserted to a container with the class `posts`. Make sure you have that class on your container or overwrite the selector via the `load-more-posts-js-vars` filter
## Motivation
I build a lot of sites that needed a functionality like this and decided to create a plugin for it. Although there are a lot of plugins doing something like this, they usually add a lot of bloat and are not developer friendly. This plugin is for a developer easier to implement, easier to edit and keeps te codebase cleaner.
## Installation
Clone this repo to your plugins or mu-plugins folder. When you load it in your mu-plugins folder, you have to call the plugin via a file that is directly in the `mu-plugins` folder. See [this article](https://www.sitepoint.com/wordpress-mu-plugins/) for more information.
## License
GNU GENERAL PUBLIC LICENSE