Navigation überspringen

[Gelöst] Question About 'Limit & Offset' in Views

This support ticket is created vor 4 Jahren, 11 Monaten. 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)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von julieP vor 4 Jahren, 11 Monaten.

Assistiert von: Shane.

Author
Artikel
#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

Sprachen: Englisch (English )

Zeitzone: 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