Saltar navegación

[Resuelto] Question About 'Limit & Offset' in Views

This support ticket is created hace 5 años. 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)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por julieP hace 5 años.

Asistido por: Shane.

Autor
Mensajes
#1462099

If I have a View based on a custom post type where there is only ever ONE post, is it more efficient to set the Limit & Offset to 1? I suspect doing so would have the same effect as using 'no_found_rows' => true in WP_Query args; is this correct?

Thanks

#1462171

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Julie,

Thank you for getting in touch.

Setting the limit and offset to one ensure that your view will only return one post. All it is doing is setting the SQL to return only one post rather than returning all the post.

"I suspect doing so would have the same effect as using 'no_found_rows' => true in WP_Query args; is this correct?"

That is also correct.

Thanks,
Shane

#1468493

Thank you for confirming