Paginate list of posts from static home page showing single post?
-
I’ve got a static home page template that shows that page’s contents. Below it, it has another query to show the most recent post. I’m using next_posts_link to link to more recent posts. Website is https://www.pugix.com
The problem is that on the paginated results, the same query is run for each page, so it never goes deeper. I’m only showing one post on the homepage, so the remaining posts that would have been paginated on that page are lost unless I use an offset to recover the missing posts. But I don’t have the right way of doing it. Basically, the new query runs on page 2, but then runs again on every page thereafter because I’m using the conditional is_front_page().
if (!is_front_page()) { query_posts('offset=1'); } if (have_posts()) : while (have_posts()) : the_post();
How to solve this?
If I could generate the query only on page 2, that would work, but I don’t see how to do that. If I don’t use an offset, I do get correct pagination BUT I lose the rest of the first page results which didn’t get to display on page 1, the homepage.
Thanks in advance for suggestions!
–Diana
- The topic ‘Paginate list of posts from static home page showing single post?’ is closed to new replies.