Skip Navigation

[Resuelto] Displaying more than 50 posts in a View

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem: I would like to display more than 50 results in an unpaginated View.

Solution: Use this custom code to increase the number of posts per page:

add_filter( 'wpv_filter_query', 'set_arbitrary_limit', 99, 3 );
function set_arbitrary_limit( $query_args, $view_settings, $view_id ) {
  $views = array( 12345 );
  if ( in_array( $view_id, $views ) ) {
    $query_args['posts_per_page'] = 67890;
  }
  return $query_args;
}

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

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

This support ticket is created hace 6 años, 1 mes. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Charles hace 6 años, 1 mes.

Asistido por: Christian Cox.

Autor
Mensajes
#1131496

Support,

How can I increase the number of posts displayed for my View above 50?

I tried to implement this code, but I'm not using pagination: https://toolset.com/forums/topic/make-more-than-50-posts-show-on-paginated-view/

Thanks,
Charles

#1131516

Hi, here's an updated snippet:

add_filter( 'wpv_filter_query', 'set_arbitrary_limit', 99, 3 );
function set_arbitrary_limit( $query_args, $view_settings, $view_id ) {
  $views = array( 12345 );
  if ( in_array( $view_id, $views ) ) {
    $query_args['posts_per_page'] = 67890;
  }
  return $query_args;
}

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

#1131998

My issue is resolved now. Thank you!