How to skip the first few entries in a "load more" scenario with Element API? I have a website that uses a &quot;load more&quot; button. The process for this button can be found here:
http://craftsnippets.com/articles/infinite-scrolling-and-lazy-loading-with-craft-cms
I made it pretty much verbatim (structure-wise with Element API) to that article, but I want to skip the first 6 entries because they are featured elsewhere on the site. So I tried to add .offset('6') to the for loop, and that did skip the first 6 entries. But when the &quot;load more&quot; button is clicked it would display the second 6 entries again (duplicates) then when you click the button again it properly continues down the list of entries.
So, how can I skip the first 6 entries in this scenario without having duplicates?
If you always want to skip the first 6 entries, you can modify the Element API endpoint to add 6 to the offset number in the query criteria:
$criteria = [
    'section' =&gt; $settings['section'], 
    'limit' =&gt;  $settings['limit'],
    'offset' =&gt;  ($settings['limit'] * Craft::$app-&gt;request-&gt;getParam('offset')) + 6,
    'order' =&gt; $settings['orderBy'],
];

That should mean you're always receiving results that are offset by the required amount for your request, plus the first 6 entries that you always want to skip.