=== WordPress Infinite Scroll by Auto Load Next Post ===
Contributors: autoloadnextpost, sebd86
Donate link: https://www.buymeacoffee.com/sebastien
Tags: AJAX, ajax load posts, ajax pagination, ajax posts, infinite, infinite scroll, infinite scrolling, post scrolling, pagination, scroll, post history, browsing history, navigation
Requires PHP: 5.6+
Requires at least: 4.4
Tested up to: 4.9.8
Stable tag: 1.5.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Increase the pageviews on your site and reduce bounce rates as readers continue reading your posts infinitely scrolling down the page.
== Description ==
You have great content. That's great but you shouldn't have to work twice as hard to get the pageviews you want. While Auto Load Next Post is not the only infinite scrolling plugin out there it is the first that is designed to work and match the theme you are using and track the content that is viewed and not the excerpts in your post archives like other plugins out there. All of your posts content!
**Auto Load Next Post templating experience is the best in class - _by a long shot_.**
Don't take my word for it. [Read what Rich Tabor](https://wordpress.org/support/topic/best-in-class-35/) (Author of [ThemeBeans](https://themebeans.com/?utm_source=wp-plugin-repo&utm_medium=link)) had to say in his review.
= What is Auto Load Next Post? =
Auto Load Next Post is a WordPress plugin developed to increase your pageviews by engaging the site viewers to keep reading your content rather than increasing your bounce rate.
It simply automatically loads the next post on your blog once the user has reached the bottom of the initial post the viewer is reading and repeats the process as the user reads your content until there are no more posts to load.
= How does it work? =
A post navigation at the end of the post is used to identify and find the previous post URL for the next post to load. Once the previous post has been found it loads that post by inserting the content via a customizable repeater template and places the content underneath the parent post within the post container.
JavaScript detects when you are reading the next post and updates your browser URL address bar and page title to that post. Should you refresh the browser, the post you are currently reading would load as the new initial post.
All previous posts of the blog are still retained in your browser history and to top it off, you can track each post read the same way a single post is tracked as a pageview using Google Analytics.
= Note to Beginners =
Auto Load Next Post is a plugin _designed_ for self-hosted WordPress sites. This means you will need to [switch from WordPress.com to WordPress.org](http://www.wpbeginner.com/wp-tutorials/how-to-properly-move-your-blog-from-wordpress-com-to-wordpress-org/) if you want to use this plugin on your WordPress site.
= Demo Site =
Want to see how it works? [Go to the demo site](https://demo.autoloadnextpost.com/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=demo-link) and view any single post. Scroll down and see the plugin in action.
= Increase Your PageViews Today =
Intrigued? _I bet you are._ Once you try Auto Load Next Post, your pageviews will increase and you will not want to go back. **Guaranteed.**
= Built with developers in mind =
Extendable and open source — Auto Load Next Post is created with developers in mind. There are opportunities for developers at all levels to contribute. [Click here to contribute](https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md).
Need to trigger something during each post load? [See the JavaScript triggers available](https://autoloadnextpost.com/documentation/javascript-triggers/) in the documentation for details. 3rd-party supported also.
Want to provide feedback or discuss plugins to be supported, features to be added, integrations and provide suggestions for Auto Load Next Post for future releases. Come [join the Slack channel](https://launchpass.com/autoloadnextpost).
= Free Add-ons =
WordPress.org is home to some great add-ons for Auto Load Next Post, including:
- [Facebook Pixel Tracking](https://wordpress.org/plugins/alnp-facebook-pixel-tracking/)
Keen to see them all? Search WordPress.org for ‘Auto Load Next Post’ to dive in.
> Have a free add-on for Auto Load Next Post? [Let me know about it](https://autoloadnextpost.com/contact/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=have-addon-to-share-link).
> #### Auto Load Next Post Pro
> Want more? _I bet you do._ A premium extension is currently in development with some of the most highly requested features. Here are just a few:
>
> - Page and Media Attachment Support
> - Custom Post Type Support
> - Paginated Posts Supported
> - Exclude Post Formats
> - Limit Posts per Session
> - Query Posts by Category or Tag
> - Exclude User Roles and Specific Users
>
> On top of that you also get:
> - Email Support
> - and many more features and add-ons to follow.
>
> [More information](https://autoloadnextpost.com/pro/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-info-link) | [Sign up to be notified >>](http://eepurl.com/bvLz2H)
This plugin is created and maintained by [Sébastien Dumont](https://sebastiendumont.com).
**More information**
- [Visit Auto Load Next Post website](https://autoloadnextpost.com/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=more-info-link) to learn more.
- [View Documentation](https://autoloadnextpost.com/documentation/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=more-info-link) for guides and code snippets.
- If you're a developer yourself, follow or contribute to the [Auto Load Next Post plugin on GitHub](https://github.com/AutoLoadNextPost/auto-load-next-post)
== Installation ==
= Automatic installation =
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser. To do an automatic install of Auto Load Next Post, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
In the search field type "Auto Load Next Post" and click Search Plugins. Once you've found the plugin you can view details about it such as the point release, rating and description. Most importantly, of course, you can install it by simply clicking "Install Now".
= Manual installation =
The manual installation method involves downloading the plugin and uploading it to your web server via your favourite FTP application. The WordPress codex contains [instructions on how to do this here](https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).
If the theme already supports Auto Load Next Post then you do not need to complete the remaining steps:
1. Go to the plugin settings page by 'Settings > Auto Load Next Post'.
2. Enter each of the selectors specified for the theme you are using and press "Save Changes".
= Updating =
Automatic updates should work like a charm; as always though, ensure you backup your site just in case.
== Frequently Asked Questions ==
= Is Auto Load Next Post free? =
Yes! Auto Load Next Post's core features are and always will be free.
= Will Auto Load Next Post work with my theme? =
Yes, Auto Load Next Post will work with any theme but may require some configuration for it to understand your theme. Please see the [documentation](https://autoloadnextpost.com/documentation/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link) for help or read further down to see if your question has already been answered.
= Is Auto Load Next Post translatable? =
Yes! Auto Load Next Post is deployed with full translation and localization support via the 'auto-load-next-post' text-domain. [How to translate?](https://autoloadnextpost.com/documentation/can-i-install-auto-load-next-post-language/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link)
= Where can I request new features and add-ons? =
You can vote on and request new features and add-ons on the [public roadmap](https://trello.com/c/OcC1oDGE/1-submitting-new-ideas).
= Where can I find the settings for this plugin? =
Go to **Settings -> Auto Load Next Post**. There you will find the options to change any of the theme selectors, enable Google Analytics and remove comments.
= Is overriding the repeater template file required? =
No. This was put in place to support themes that have coded their template files differently from [WordPress theme code standards](https://codex.wordpress.org/Theme_Development#Theme_Development_Standards). For example, the [Genesis Framework](https://autoloadnextpost.com/product/genesis-framework-support/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link) displays content via many action hooks instead so for this case overriding the template is a required.
= How can I override the repeater template file? =
You first need to create a new folder in your active theme directory called **auto-load-next-post** like so: **wp-content/themes/your-theme-name/auto-load-next-post/** and copy the repeater template file **content-alnp.php** from the plugin template folder into that new folder.
Now you can modify it to match how your theme’s content is loaded for a single post. This will be the repeater template the plugin will use to load posts with from now on.
> PHP knowledge will be required.
= Can I use JetPack Social Links and Like Button? =
Yes. No further configuration is needed if you already have JetPack setup with social icons and like button.
= Is it compatible with the JetPack's related posts module? =
This is not possible but it would also drive away the purpose of this plugin if related posts where to be displayed.
= Can I load content before and after the next post has loaded? =
Yes, you can. In the repeater template, there are [action hooks](https://autoloadnextpost.com/documentation/action-hooks/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link) that you can use.
I have also prepared a [plugin demonstrating](https://github.com/AutoLoadNextPost/alnp-action-hooks-demonstration) the action hooks used when called. Simply download and install the plugin to see where you can place content.
= After the first post has loaded, all I get is the same post over and over again. Why is that? =
If you have this issue and you have created a custom repeater template file to support the theme then you may have placed the post navigation outside of the post query.
You need to place it inside the loop. If that is not the case then you have not included the content of the post correctly according to the theme you are using.
= Does the plugin detect my theme and insert the theme selectors for me? =
If the theme author has added support for Auto Load Next Post and has set the theme selectors then yes, it will set the theme selectors for you. If not supported then it does not. You may follow this guide to help you [find your theme selectors](https://autoloadnextpost.com/documentation/find-theme-selectors/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link).
= My theme does not work with the plugin, what do I do? =
Check that you have a post navigation at the end of your post. If one does exists then you may need to copy and modify the repeater template file **content-alnp.php** in order to support your theme.
Not all themes are coded the same way so some alterations will be needed to match the theme. If you need help with this then I can provide [theme support](https://autoloadnextpost.com/product/theme-support/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link) on request.
= What is the post order? =
The post order is descending order from the initial post the visitor started reading from.
= How can I get the Google Analytics option to work? =
You first need to have Google Analytics added to your site. Either by inserting the analytics into your theme yourself or by using the [Google Analytics plugin by MonsterInsights](https://wordpress.org/plugins/google-analytics-for-wordpress/).
Once you have Google Analytics applied to your site you can enable to track each post via the plugin settings.
= Can I track Facebook Pixels instead? =
You can. All you have to do is simply install the [Facebook Pixel Tracking add-on](https://wordpress.org/plugins/alnp-facebook-pixel-tracking/) and activate. All that is required is that you have your Facebook Pixel tracker installed on the site first.
= Does Auto Load Next Post support WordPress Network / Multisite websites? =
It does. Just make sure that you activate the plugin on the site you want it used on and then make sure the selectors match the theme that site is using.
== Screenshots ==
1. Plugin Settings: Theme Selectors, here is where we define the elements Auto Load Next Post will look for.
2. Plugin Settings: Misc Settings, here you can enable Google Analytics tracking, remove comments and set the JavaScript to load in the footer of your website instead should you need to.
3. Plugin Settings: Events, here you can support custom triggers or 3rd-party plugins to trigger their own once a post has loaded or when the visitor is entering a post.
4. Theme Customizer: The same settings can be applied via the theme customizer.
== Changelog ==
= 1.5.2 : 14th September 2018 =
* Reverted: The JavaScript from not requiring the document to be ready due to JS minification breaking it.
= 1.5.1 : 14th September 2018 =
* Fixed: No such file for including the admin settings when setting default options due to a file rename.
= 1.5.0 : 14th September 2018 =
* NEW: All settings are available in the theme customizer.
* NEW: Option to load the JavaScript in the footer.
* NEW: Support for themes that require Auto Load Next Post to load in the footer.
* NEW: Added trigger event support for third-party plugins thanks to Stelios Patsatzis.
* NEW: Support for theme Make, Storefront and Understrap.
* NEW: Privacy policy guide content.
* NEW: Beta notice if trying out beta releases. Explains how you can provide feedback and can be dismissed for 7 days.
* NEW: Welcome notice to users who install Auto Load Next Post for the first time.
* Added: A check to see if JetPack is active.
* Added: A check in the JavaScript to prevent it from loading if a user is requesting to post a comment. - Initial post only.
* Added: A filter for the repeater template location so theme or plugin developers can move it to another location should they need to.
* Added: A user agent checker to see if the request was made from a known bot.
* Added: Detection of plugin support. If supported, set the theme selectors for the currently active theme even when the theme has changed.
* Added: Admin notice to tell the user the theme supports Auto Load Next Post. Only shows once.
* Added: Admin notice to tell the user the theme selectors have already been set by the current theme if that theme supports Auto Load Next Post.
* Added: Admin notice under "Theme Selectors" settings only if all three or one of the required theme selectors is not set.
* Added: Admin notice under the "Misc" settings only if remove comments was enabled but the comments container selector was not set.
* Added: A sidebar to the settings page to promote Auto Load Next Post Pro and allow users to sign up.
* Added: Select2 to replace previous JavaScript library "chosen" for better support and performance.
* Changed: Rewrite endpoint to be more distinct for Auto Load Next Post and prevent any conflicts.
* Changed: Settings have been separated into Theme Selectors and Miscellaneous settings.
* Changed: The JavaScript now does not require the document to be ready. This is especially helpful if you have enabled the JavaScript to load in the footer.
* Fixed: The trigger to override the post URL.
* Fixed: Install date to a timestamp for those who have previously installed Auto Load Next Post so when you see the review notice, it does not say it's been 48 years since you installed because that is just crazy. LOL :laughing:
* Improved: Theme support and all default WordPress themes are supported out of the box. (Twenty Ten to Twenty Seventeen)
* Improved: Moved flushing rewrite rules so it only runs once during installation or updating Auto Load Next Post.
* Improved: Admin setting fields and added placeholder support.
* Improved: Inline PHPdocs
* Renamed: Repeater template from content-partial.php to content-alnp.php
* Removed: Admin notice for the theme has not declared support.
* Removed: Template location filter from the repeater template as it has been moved for better support.
* Removed: PHP version check.
* Removed: JavaScript library "chosen".
* Updated: POT file for translation.
* Updated: Repeater template due to improvements with this release.
[See changelog for all versions](https://raw.githubusercontent.com/AutoLoadNextPost/Auto-Load-Next-Post/master/CHANGELOG.md).
== Upgrade Notice ==
= 1.5.0 : 14th September 2018 =
This release brings many improvements, enhancements and better theme support. [See blog post](https://autoloadnextpost.com/2018/05/28/whats-coming-in-v1-5-0-of-auto-load-next-post/) for more details.