Skip Navigation

[Résolu] Question About 'Limit & Offset' in Views

This support ticket is created Il y a 4 années et 10 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par julieP Il y a 4 années et 10 mois.

Assisté par: Shane.

Auteur
Publications
#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

Les langues: Anglais (English )

Fuseau horaire: 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