Skip Navigation

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

This support ticket is created 4 years, 3 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 julieP 4 years, 3 months ago.

Assisted by: Shane.

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

Languages: English (English )

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

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.