=== Ajax Load More === Contributors: dcooney Donate link: http://connekthq.com/donate/ Tags: infinite scroll, scroll, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, shortcode builder, wp_query, search, tags, category, post types, comments, taxonomy, meta_query, archives, date, endless, endless scroll Requires at least: 3.6 Tested up to: 4.4 Stable tag: 2.8.5 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html A powerful solution to add infinite scroll functionality to your website == Description == Ajax Load More is the ultimate solution for infinite scrolling and lazy loading posts, custom post types, single posts, pages and comments with Ajax powered queries. Build complex WordPress queries using the Ajax Load More custom shortcode builder then add the shortcode to your pages via the content editor or directly into your template files. **[Get More Information](http://connekthq.com/plugins/ajax-load-more/)** = Features = * **Shortcode Builder** - Easily create your own Ajax Load More shortcode by adjusting the various WordPress query parameters in our easy-to-use shortcode builder.(see Shortcode Parameters). * **Query Parameters** - Ajax Load More allows you to query WordPress by many different content types. Query by Post Type, Post Format, Date, Category, Tags, Custom Taxonomies, Search Term, Authors and more!! * **Customizable Repeater Templates** - Edit and extend the functionality of Ajax Load More by creating your own repeater template to match the look and feel of your website (see screenshots). * **Setting Panel** - Customize your version of Ajax Load More by updating various plugin settings (see screenshots). * **Multiple Instances** - You can include multiple instances of Ajax Load More on a single page, post or template. * **Multisite Compatibility** - As of Ajax Load More 2.7.2 you can now manage repeater templates across all sites in your network. Check out the **[demo site](http://connekthq.com/plugins/ajax-load-more/)** for more information! *** = Content Types = Ajax Load More will allow for infinite scrolling of pretty much any content type WordPress offers. * [Posts](https://connekthq.com/plugins/ajax-load-more/examples/default/) * [Custom Post Types](https://connekthq.com/plugins/ajax-load-more/examples/masonry/) * [Pages](https://connekthq.com/plugins/ajax-load-more/examples/search-results/) * [Single Posts](https://connekthq.com/ajax-load-more-posts/alm-post-example/) ** * [Comments](http://comments.connekthq.com/example-post/) ** ** Add-on required = Shortcode Parameters = Ajax Load More accepts a number of parameters that are passed to the WordPress query. These parameters are transferred via shortcode - don't worry, creating your shortcode is simple with our intuitive Shortcode Builder. * **repeater** - Choose a repeater template (Add-on available). Default = ‘default’ * **theme_repeater** - Select from a list of template files in your current theme directory (Add-on only). Default = null * **post_type** - Comma separated list of post types. Default = ‘post’ * **post_format** - Query by post format. Default = null * **category** - A comma separated list of categories to include by slug. Default = null * **category__not_in** - A comma separated list of categories to exclude by ID. Default = null * **tag** - A comma separated list of tags to include by slug. Default = null * **tag__not_in** - A comma separated list of tags to exclude by ID. Default = null * **taxonomy** - Query by custom taxonomy name. Default = null * **taxonomy_terms** - Comma separated list of custom taxonomy terms(slug). Default = null * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’ * **taxonomy_relation** - The logical relationship between each taxonomy when there is more than one. (AND/OR). Default = ‘AND’ * **day** - Day of the week. Default = null * **month** - Month of the year. Default = null * **year** - Year of post. Default = null * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’ * **meta_key** - Custom field key(name). Default = null * **meta_value** - Custom field value. Default = null * **meta_compare** - Operator to compare meta_key and meta_value against. Default = ‘IN’ * **meta_type** - Custom field type. Default = ‘CHAR’ * **meta_relation** - Used with multiple custom field entries (AND/OR). Default = ‘AND’ * **author** - Query by author id. Default = null * **post__in** - Comma separated list of post ID’s to include in query. Default = null * **post__not_in** - Comma separated list of post ID’s to exclude from query. Default = null * **search** - Query search term (‘s’). Default = null * **custom_args** - A semicolon separated list of value:pair arguments. e.g. tag_slug__and:design,development; event_display:upcoming. Default = null * **post_status** - Select status of the post. Default = 'publish' * **order** - Display posts in ASC(ascending) or DESC(descending) order. Default = ‘DESC’ * **orderby** - Order posts by date, title, name, menu order, random, author, post ID or comment count. Default = ‘date’ * **offset** - Offset the initial query (number). Default = ’0′ * **posts_per_page** - Number of posts to load with each Ajax request. Default = ’5′ * **scroll** - Load more posts as the user scrolls the page (true/false). Default = ‘true’ * **scroll_distance** - The distance from the bottom of the screen to trigger the loading of posts while scrolling. Default = '150' * **max_pages** - Maximum number of pages to load while user is scrolling (activated on when scroll = true). Default = '5' * **pause_override** - Allow scrolling to override the Pause parameter and trigger the loading of posts on scroll. Default = null * **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false' * **transition** - Choose a posts reveal transition (slide/fade/none). Default = 'slide' * **images_loaded** - Wait for all images to load before displaying ajax loaded content (true/false). Default = 'false' * **destroy_after** - Remove ajax load more functionality after 'n' number of pages have been loaded. Default = null * **button_label** - The label text for Load More button. Default = 'Older Posts' * **button_loading_label** - Update the text of the Load More button while content is loading. Default = null * **container_type** - Override the global Container Type that was set on ALM Settings page. Default = null * **css_classes** - Add custom CSS classes to the Ajax Load More container. Default = null * **cache** - Turn on content caching for the specific Ajax Load More query. add-on only - (true/false). Default = ‘false’ * **cache_id** - A unique 10 digit ID for the cached query. add-on only - Default = A random 10 digit integer * **seo** - Enable address bar URL rewrites as users page through content - add-on only (true/false). Default = ‘false’ * **preloaded** - Should Ajax Load More preload posts? add-on only - (true/false). Default = ‘false’ * **preloaded_amount** - The amount of posts to preload. add-on only - Default = ‘5’ * **paging** - Replace infinite scrolling with a paged navigation system. add-on only (true/false). Default = ‘false’ * **paging_controls** - Show previous(«) and next(») buttons (true/false). Default = ‘false’ * **paging_classes** - Add classes to the paging navigation menu for CSS styling. * **paging_show_at_most** - Maximum amount of pages to show at a time. 0 = no maximum. Default = ‘0’ *** = Example Shortcode = [ajax_load_more post_type="post, portfolio" repeater="default" posts_per_page="5" transition="fade" button_label="Older Posts"] *** = Demos = * **[Default](http://connekthq.com/plugins/ajax-load-more/)** - Out of the box functionality and styling * **[Destroy After](http://connekthq.com/plugins/ajax-load-more/examples/destroy-after/)** - Remove Ajax Load More functionality after 'n' number of pages * **[Fade Transition](http://connekthq.com/plugins/ajax-load-more/examples/fade-transition/)** - Elements fade in as posts are loaded * **[Filtering](http://connekthq.com/plugins/ajax-load-more/examples/filtering/)** - Reset and filter an Ajax Load More instance * **[Infinite Scroll](http://connekthq.com/plugins/ajax-load-more/examples/infinite-scroll/)** - A look at the new loading functionality and style * **[Images Loaded](http://connekthq.com/plugins/ajax-load-more/examples/images-loaded/)** - Download images before displaying ajax loaded content * **[Masonry](http://connekthq.com/plugins/ajax-load-more/examples/masonry/)** - Creating a flexible grid layout with Masonry JS * **[Multiple Instances](http://connekthq.com/plugins/ajax-load-more/examples/multiple-instances/)** - Include multiple Ajax Load More' on a single page * **[Paging URLs](http://connekthq.com/plugins/ajax-load-more/examples/paging-urls/)** - Generate unique paging URLs for every Ajax Load More query with the SEO add-on * **[Pause Loading](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Posts will not load until initiated by the user * **[Preloaded Posts](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Easily preload an initial set of posts before completing any Ajax requests to the server * **[Search Results](http://connekthq.com/plugins/ajax-load-more/examples/search-results/)** - Returning results based on search terms * **[SEO & Paging](https://connekthq.com/plugins/ajax-load-more/examples/seo-paging-add-ons/)** - Combine these two add-ons to create one powerful navigation system * **[Slideshow Gallery](https://connekthq.com/plugins/ajax-load-more/examples/slideshow-gallery/)** - Create a gallery of posts with Ajax Load More and the Paging add-on. *The [Custom Repeater Add-On](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/) has been installed for use on each of our product demos* [youtube https://www.youtube.com/watch?v=EQ57i6dkOew] *** = Add-ons = The following Add-ons are available to increase the functionality of Ajax Load More. > #### Cache > The **[Cache](http://connekthq.com/plugins/ajax-load-more/cache/)** add-oncreates static HTML files of Ajax Load More requests then serves those static pages to your visitors without querying the database.
> [Get More Information](http://connekthq.com/plugins/ajax-load-more/cache/) > > #### Comments > The **[Comments](http://connekthq.com/plugins/ajax-load-more/add-ons/comments/)** add-on will load and display blog comments using the core Ajax Load More infinite scroll functionality.
> [Get More Information](http://connekthq.com/plugins/ajax-load-more/add-ons/comments/) > > #### Custom Repeaters > The **[Custom Repeaters](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/)** add-on will allow for **unlimited repeater templates** and provide the ability to create unique templates for different content types throughout your theme.
> [Get More Information](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/) > > #### Paging > The **[Paging](http://connekthq.com/plugins/ajax-load-more/paging/)** add-on will transform Ajax Load More’s lazy load/infinite scroll functionality into a robust ajax powered navigation system.
> [Get More Information](http://connekthq.com/plugins/ajax-load-more/paging/) > > #### Preloaded > The **[Preloaded](http://connekthq.com/plugins/ajax-load-more/preloaded/)** add-on will allow you to quickly and easily preload an initial set of posts before completing any Ajax requests to the server.
> [Get More Information](http://connekthq.com/plugins/ajax-load-more/preloaded/) > > #### Previous Post > The **[Previous Post](http://connekthq.com/plugins/ajax-load-more/previous-post/)** add-on will allow you to navigate single posts with Ajax Load More.
> [Get More Information](http://connekthq.com/plugins/ajax-load-more/previous-post/) > > #### Search Engine Optimization > The **[SEO](http://connekthq.com/plugins/ajax-load-more/seo/)** add-on will optimize your ajax loaded content for search engines and site visitors by generating standard WordPress paging URLs with each Ajax Load More query.
> [Get More Information](http://connekthq.com/plugins/ajax-load-more/seo/) > > #### Theme Repeaters > The **[Theme Repeaters](http://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/)** add-on will allow you load, edit and maintain templates from your current theme directory.
> [Get More Information](http://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/) *** = Callback Functions = The following [functions](https://connekthq.com/plugins/ajax-load-more/docs/callback-functions/) are available to be dispatched by Ajax Load More. **ALM Complete** - The almComplete() function is triggered after every *successful* ajax call made by Ajax Load More. $.fn.almComplete = function(alm){ // Your on complete code goes here }; **ALM Done** - The almDone() function is triggered after all posts have been loaded.. $.fn.almDone = function(alm){ console.log('All posts have been loaded!'); }; **ALM Empty** - The almEmpty() function is triggered if there are zero results returned in the initial query. $.fn.almEmpty = function(alm){ console.log('Sorry, but we could not locate any posts that matched your criteria.'); }; **ALM Filter Complete** - The almFilterComplete() function is triggered after a successful call to the public function almFilter(). $.fn.almFilterComplete = function(){ console.log('Ajax Load More filter has completed!'); }; **ALM URL Update** - The almUrlUpdate() function is triggered after a successful URL update (pushState) from the Previous Post or the Search Engine Optimization add-on $.fn.almUrlUpdate = function(permalink, type){ console.log("URL updated to " + permalink + '- dispatched from the '+ type + ' add-on.'); }; *** = Variables = Ajax Load More passes the following PHP [variables](https://connekthq.com/plugins/ajax-load-more/docs/variables/) to each repeater template - these template variables can help you style and transform your repeater templates. * **$alm_page** - Returns the current page number. 'echo $alm_page;' * **$alm_item** - Returns the current item number within your loop. 'echo $alm_item;' * **$alm_found_posts** - Returns the total number of posts found within the entire WordPress query. 'echo $alm_found_posts;' *** = Tested Browsers = * Firefox (Mac, PC) * Chrome (Mac, PC, iOS, Android) * Safari (Mac, iOS) * IE8+ * Android (Native) * BB10 (Native) *** = Website = http://connekthq.com/ajax-load-more/ *** = Please Rate Ajax Load More! = Your ratings make a big difference! If you like and use Ajax Load More, please consider taking the time to [rate my plugin](http://wordpress.org/support/view/plugin-reviews/ajax-load-more). Your ratings and reviews will help this plugin grow and provide the motivation needed to keep pushing it forward. == Frequently Asked Questions == = What are the steps to getting Ajax Load More to display on my website = 1. Create your shortcode 2. Add the shortcode to your page, by adding it through the content editor or placing it directly within one of your template files. 3. Load a page with your shortcode in place and watch Ajax Load More fetch your posts. = What are my server requirements? = Your server must be able to read/write/create files. Ajax Load More creates the default repeater on plugin activation and in order to modify the output we are required to write to the file as well. = Is the ajax functionality secure? = Yes, Ajax Load more uses admin-ajax and nonces in order to protect URLs and forms from being misused. = Can I make modifications to the plugin code? = Sure, but please be aware that if modifications are made it may affect future updates of the plugin. = Can I modify the repeater template? = Yes, visit the Repeater Template section in your WordPress admin. = How are my repeater templates saved? = Repeater template data is saved into your WordPress database as well as written directly to a repeater template .php file in the ajax-load-more plugin directory. = Can I use custom fields in a repeater? = Yes, but you will need to define $post at the top of the repeater before requesting your custom fields. Like so: global $post; == Installation == How to install Ajax Load More. = Using The WordPress Dashboard = 1. Navigate to the 'Add New' in the plugins dashboard 2. Search for 'Ajax Load More' 3. Click 'Install Now' 4. Activate the plugin on the Plugin dashboard = Uploading in WordPress Dashboard = 1. Navigate to the 'Add New' in the plugins dashboard 2. Navigate to the 'Upload' area 3. Select `ajax-load-more.zip` from your computer 4. Click 'Install Now' 5. Activate the plugin in the Plugin dashboard = Using FTP = 1. Download `ajax-load-more.zip` 2. Extract the `ajax-load-more` directory to your computer 3. Upload the `ajax-load-more` directory to the `/wp-content/plugins/` directory 4. Activate the plugin in the Plugin dashboard == Screenshots == 1. Settings screen 2. Available Repeater Templates 3. Custom Repeaters Add-On 4. Shortcode Builder 5. Content Editor shortcode icon 6. Edit Page Shortcode Builder 7. Shortcode and implementation examples == Changelog == = 2.8.5 = * FIX - Update for ALM settings screen - layout was broken with WP 4.4 release. * NEW - Adding new functionality to allow for loading of local default repeater template. Users can create a /alm_templates directory within their current theme and add default.php. If default.php is present it will be loaded before repeater template shipped with Ajax Load More. * NEW - Adding multiple taxonomy support - you can now query WordPress by up to 3 unique taxonomy queries. * NEW - Adding taxonomy_relation shortcode parameter. * FIX - Fixed JS error in shortcode builder popup. * FIX - Fix for issue with '<' and '<=' Custom Field operators, WP was rendering these tags as HTML (https://github.com/dcooney/wordpress-ajax-load-more/issues/98). Users can now enter 'lessthan' and 'lessthanequalto' to fix this issue. * UPDATE - Changing 'exclude' shortcode parameter name to be 'post__not_in' to follow WordPress naming conventions. 'exclude' will continue to work along side 'post__not_in'. = 2.8.4 = * NEW - Adding new loading styles and button types. * NEW - Adding new 'button_loading_label' parameter allowing users to change button text while loading content. * NEW - Adding required support and functionality for new Comments add-on - https://connekthq.com/plugins/ajax-load-more/add-ons/comments/ * UPDATE - Updating JS functions for release of Previous Post v1.1. * UPDATE - Various admin enhancements and removing deprecated code. * UPDATE - removing default link color in ajax-load-more.css. = 2.8.3 = * PERFORMANCE - Updating ALM core to enqueue Ajax Load More js only when shortcode is present on screen. * NEW - Adding 'canonical-url' data attribute to ALM plugin wrapper - this will be used by various functions throughout the core plugin and add-ons. * NEW - Adding new alm-thumbnail image size. * NEW - Adding required functionality for upcoming Layouts add-on. * NEW - To increase SEO and crawler access we added a