|
how to increase display items per page on pagination? more than 50 items
Started by: mettroS
in: Toolset Professional Support
Quick solution available
Problem:
The customer wants to display more than 50 items on a single page. They are not following any documentation and do not have an example to reference.
Solution:
We informed the customer that currently, it is only possible to change the maximum items from 50 to a higher number using custom code. We provided the following code snippet to be added to their child theme's/theme's function.php file:
add_filter('wpv_filter_query', 'set_new_limit', 99, 3);
function set_new_limit($query_args, $view_settings, $view_id) {
$views = array(12345);
if (in_array($view_id, $views)) {
$query_args['posts_per_page'] = 100;
}
return $query_args;
}
It is needed to replace 12345 with the numeric ID of the View and 100 with the maximum number of posts you want to display.
|
|
2 |
2 |
6 months, 1 week ago
Mateus Getulio
|