I’m using the following code to display a custom list of channel entries:
{exp:query limit="20" paginate="bottom" sql="SELECT entry_id FROM exp_channel_titles WHERE entry_id NOT IN([...list of entry IDs…]) AND channel_id = '1' ORDER BY entry_id DESC"}
{exp:channel:entries channel="XYZ" entry_id="{entry_id}"}
...stuff…
{/exp:channel:entries}
{paginate}...{/paginate}
{/exp:query}The query returns the expected results, but the number of results per page varies. In my code snippet above, I have the limit set to 20, but on most of the pages I get fewer than 20 results per page. Put another way, I should have 11 pages of results, with 20 per page (excepting the last page), but instead I have 14 pages of results, with variable numbers of results per page.
It’s like the entries I don’t want to show are still “there” for pagination purposes, even though they are neither pulled from the database nor displayed on the page.
How can I adjust my code to display the full 20 results per page?