LAMA (Italian word for BLADE) is a utility class that helps you to quickly implement the Load More & dynamic filtering functionality in WordPress.
NOTE: Php >= 7.2 is required earlier version are not supported.
Run the following command in your terminal to install Lama with Composer
$ composer require "93digital/lama @dev"
Below is a basic example of getting started with the class, though your setup may be different depending on how you are using composer.
<?php require __DIR__ . '/vendor/autoload.php'; \Nine3\Lama::init();
Download/Clone this repository and load the main class file into your theme/plugins like so:
require_once 'lama/class-lama.php'; \Nine3\Lama::init();
Build the JS
npm run build
When the debug is enabled in WordPress LAMA automatically outputs, in the
debug.log file, the following information:
- the $args array parameters passed to the WP_Query (when performing the ajax request)
- the template that is trying to load for each element found
In alternative is possible to set the constant
true to output that information inside the
wp-content/lama.log file, add the following line to your starter theme/plugin:
define( 'LAMA_DEBUG', true );
The class comes with an extensive documentation available here