How to use the load more pagination

The Posterno search forms extension comes with a "load more" type of pagination. This type of pagination provides a button that once clicked, loads more search results without refreshing the page via ajax. 

This type of pagination might require modifications to your theme in order for it to work. 

Note: This is a Developer level doc provided as guidance. We are unable to dispense advice or review code under our Support Policy.

Usage

This type of pagination can only be used on a faceted supported query. Please review the "Limitations" section on this article for more info: https://docs.posterno.com/article/617-how-to-display-facets-on-your-pages

To add the "load more" pagination, you need to use the following shortcode:

[pno-search-load-more]

Theme compatibility

The load more button, once pressed, will automatically use the whole content block of the listings query, it will replicate it, but substitute it's content with the additional results to load. This causes an unwanted issue that can lead to parts of the layout to load again. See the screenshots below to better understand it.

If used with the default shortcodes provided by Posterno, the pagination and sorters will automatically be replicated after pressing the load more button. This side effect happens because Posterno tries to be compatible with as many themes as possible. The load more pagination however must be manually integrated with the help of some custom coding.

You now have 3 options to adjust the layout. 

First option: use css to hide the elements

While this isn't the best option, it's definitely the easiest option. You can use css to target those elements and hide them. This is particularly useful if you don't wan't to customize the template files of the plugin.

Second option: customize the template files to remove the elements

You can customize the template files of posterno to remove the layout elements that are replicated. If your theme doesn't declare custom support for template files you can customize the taxonomy.php and templates/shortcodes/listings-page.php by following the customization article here https://docs.posterno.com/article/545-templates-customization and remove the elements from the files.

Third option: build a custom query

Another option is to create a custom query. As long as you mark the query to be detected by the search facets the load more pagination will automatically work with your custom query template. Please refer to the "limitations" section here https://docs.posterno.com/article/617-how-to-display-facets-on-your-pages to learn how to make queries supported by the facets.