Hope this is the right area of the forum for this.
We have a blog section on our website that displays 10 entries per page however, when you click next page or ‘2’ it returns an empty page with a /P10 in the URL.
From what I can see the code is the same as for our news page and that’s working fine. I’ve looked through similar issues on the forums but can’t find a fix that works.
The code for the entries is:
{exp:channel:entries channel="blog" orderby="date" paginate="bottom" limit="10" {if segment_2}author_id="{segment_2}"{/if} dynamic="no"}
And the code for the pagination is:
{paginate}
Showing page {current_page} of {total_pages} <span>{pagination_links}</span>
{/paginate}
Can anyone see what would be causing the issue?
Let me know if there’s any more info you’d need.
Hi tvr1982,
What do the full URL segments look like for the blog section with the pagination segment? For example, is it just /blog/P10? If so then the {if segment_2} conditional in the channel entries tag would be interfering with the pagination segment because it’s trying to use P10 to find an author ID.
Thanks Stephen, I hadn’t realised that was what that related to, I’m sure it hadn’t caused an issue until recently though which seems strange.
I’ve changed the author_id to {segment_3} and amended the code for the authors section to the following
{exp:top_authors channel="blog"}
<li><a href="/blog/author/{author_id}">{name} ({count})</a> </li>
{/exp:top_authors}
adding in the “/author/” segment after the /blog/ and this has fixed the issue, pagination works and the author filter works.
Do you think writing it like this could cause any other issues?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.