DocumentationOnline documentation for Ajax Load More
Implementation Methods
Ajax Load More Filters can be implemented on the frontend via shortcode or the alm_filters PHP function.
Shortcode
The shortcode render method can be used to insert a shortcode in the code editor or a theme template.
1 2 3 4 5 |
// Template (.php) echo do_shortcode('[ajax_load_more_filters id="my_post_filter" target="YOUR_ALM_ID"]'); // Page Editor [ajax_load_more_filters id="my_post_filter" target="YOUR_ALM_ID"] |
alm_filters (PHP Function)
The alm_filters() method must be implemented via page template (php) or backend functions file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$filter_array = array( "id" => "my_post_filter", "filters" => array( array( "key" => "taxonomy", "field_type" => "checkbox", "taxonomy" => "category", "taxonomy_operator" => "IN", "taxonomy_include_children" => "false", "title" => "Categories", ) ) ); echo alm_filters( $filter_array, 'YOUR_ALM_ID' ); |
When passing an array of data to the alm_filters() function, it’s very important that you do NOT delete the filter from the WordPress backend as it is still required for various frontend functionality.
The alm_filters() method can also accept a reference to a Filter ID in place of the data array.
1 |
echo alm_filters( 'my_post_filter', 'YOUR_ALM_ID' ); |
Note: Don’t forget to replace YOUR_ALM_ID in the samples above with your Ajax Load More ID.