Skip Navigation

[Resolved] how to increase display items per page on pagination? more than 50 items

This thread is resolved. Here is a description of the problem and solution.

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.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Mateus Getulio 6 months, 1 week ago.

Assisted by: Mateus Getulio.

Author
Posts
#2697353

Tell us what you are trying to do? I want to display more items on a single page, more than 50

Is there any documentation that you are following? No

Is there a similar example that we can see? No

What is the link to your site?

#2697447

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I'm afraid that as of now, only by using some custom code it is possible to change the maximum items from 50 to a higher number.

Please add the following code to your 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;
}

Replace 12345 with the numeric ID of your View and replace 100 with the maximum number of posts you want to display.

Please give it a try and let us know.
Mateus