Hi @agengpd
This is not because of the lcp_paginator
class.
You are correct, with the setup I described previously it only works witn one LCP instance on a page. If you look at the Ajax plugin settings you will see that under “Posts selector” there is this info “If displaying multiple paginations on the same page this must be a parent of the navigation selector.” and under “Navigation Selector” there is “If displaying multiple paginations on the same page this must be a child of the posts selector.”
In the default LCP html output the navigation selector is not a child of the posts selector, i.e. .lcp_paginator
is a sibling of .lcp_catlist
. It must be a child for multiple LCP instances to work with the Ajax plugin.
This can be solved by using LCP custom templates. Follow the docs to setup your template. In the default template file you will see that pagination is inserted on line 117:
//Pagination
$lcp_display_output .= $this->get_pagination();
but the loop wrapper, i.e. posts selector, is closed earlier on line 108:
// Close the wrapper I opened at the beginning:
$lcp_display_output .= '</ul>';
So now we need to make the pagination a child, not a sibling, of the posts selector. That’s easy: move the pagination code above the wrapper closing tag.
One important thing to note here is that if you only do that, your list will look a bit differently than without a custom template. This is because the default.php
template file produces a slightly different output, for instance it wraps titles in h3 tags. But you can adjust it to what you need without much effort.
Cheers