Ajax Load More uses a templating system referred to as Repeater Templates to manage the front-end display and styling of your Ajax loaded content.
A Repeater Template is a snippet of code that will execute over and over to display post content within an Ajax Load More loop. These templates will typically consist of a combination of HTML, PHP and core WordPress functions such as the_title() and the_permalink().
Out of the box, Ajax Load More offers a single fully editable template which allows users to quickly match the look and the feel of their website to the Ajax loaded content.
The default template can be edited and managed using one of the methods listed below:
The standard Ajax Load More template is fully editable with syntax highlighting enabled and allows you to take full control over what content is displayed to your visitors. This template is modified within the Ajax Load More interface, saved inside the plugin folder on the server (ajax-load-more/core/repeater) and stored in the database.
Pro Tip: Always open and close your repeater templates with an HTML element – In some rare cases data may display incorrectly or not be displayed at all.
e.g. <article> // template code here </article>
The theme template method offers the ability to load and manage the default Ajax Load More template directly from the current theme directory using functionality similar to the Theme Repeaters add-on. This method allows theme authors to package Ajax Load More with their commercial themes and also makes it easier to reuse templates throughout other sections of a website.
To start working with a theme template you must:
- Create an /alm_templates directory at the root of your current theme folder.
- Create and/or upload a default.php template to this newly created /alm_templates directory.
If default.php is located in your current theme folder it will be loaded as the plugin default and take precedence over the core Ajax Load More repeater template.
NOTE: Your file must be named default.php.
Users wanting to extend the core Ajax Load More plugin to allow for unlimited repeater templates have the option of the following template add-ons:
The Custom Repeaters add-on will unlock the ability to create an infinite number of repeater templates.
Create, modify and delete repeater templates as you need them with absolutely zero restrictions. The Custom Repeaters add-on allows you to create unique layouts for different content types throughout your theme.
The Theme Repeaters add-on will allow you to create, edit and load Ajax Load More repeater templates directly from your current theme directory.
Gain complete control over Ajax Load More repeater templates and add ability to easily reuse templates throughout other sections of a website.