Skip Navigation

[Resolved] I’d like to know how to have a list of 70 items.

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

Problem:

The issue here is that our view only allows a maximum of 50 posts per page when using the pagination settings. However this user wanted to increase this to 70.

Solution:

This can be done by using the code below. Add the following to your Toolset custom code settings at Toolset->Settings->Custom Code. Once you've done this please ensure that you've activated it as well as change the ID 123 to the ID of your view.

//Increase the page limit beyond 50
add_filter( 'wpv_filter_query', 'wpcf_increase_pagination',99,3 );
  
function wpcf_increase_pagination( $query_args, $view_settings, $view_id ) {
 
    if ($view_id == 123 ) { //Edit
        $query_args['posts_per_page'] = 70;
    }
    return $query_args;
}
This support ticket is created 3 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

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 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by patriciaC-2 3 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#2230195
Screenshot 2021-11-25 at 17.17.06.png

Currently, I can have a listing page with up to 50 items. But I need specifically to have a list of 70 items per page (using pagination). How can I do this? In the dropdown menu, I can select up to 50. I don't want to use infinite scroll. Thanks!

#2230321

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Patricia,

Thank you for getting in touch.

Unfortunately there isn't a way to do this through the user interface, however you can do it with the custom hook below.

//Increase the page limit beyond 50
add_filter( 'wpv_filter_query', 'wpcf_increase_pagination',99,3 );
 
function wpcf_increase_pagination( $query_args, $view_settings, $view_id ) {

    if ($view_id == 263 ) { //Edit
        $query_args['posts_per_page'] = 70;
    }
    return $query_args;
}

Add it to your custom functions at Toolset -> Settings -> Custom Code and add a new snippet. From there you will need to change the 263 to the ID of your view then just save and activate the code.

Once you've done this then your posts per page limit should be increased to 70.

Please let me know if this helps.
Thanks,
Shane

#2231325

My issue is resolved now. Thank you!