Blog, Website & Page Publishing

pmatty
Member

Blog Pagination Showing 0

SOLVE

The first page of our blog is linking to blog/page/0 which is causing some broken links. I think it's because of how the pagination is set up in our code. I'm pasting how it appears on page 1 of the blog and how it appears in the module. 

 

pmatty_0-1729269394548.png

pmatty_1-1729269400971.png

 

I'd like to fix this, any help is appreciated!

 

0 Upvotes
1 Accepted solution
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Blog Pagination Showing 0

SOLVE

Hey @pmatty ,

 

You may need to wrap that {{ blog_page_link(last_page_num) }} in a conditional statement.

 

{% if last_page_num %}
<a class="prev-link" href="{{ blog_page_link(last_page_num) }}">
... rest of the code ....
</a>
{% endif %}

 

Hope this helps!


✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

0 Upvotes
2 Replies 2
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Blog Pagination Showing 0

SOLVE

Hey @pmatty ,

 

You may need to wrap that {{ blog_page_link(last_page_num) }} in a conditional statement.

 

{% if last_page_num %}
<a class="prev-link" href="{{ blog_page_link(last_page_num) }}">
... rest of the code ....
</a>
{% endif %}

 

Hope this helps!


✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes
pmatty
Member

Blog Pagination Showing 0

SOLVE

Heyyy that totally did it! Thanks so much for your help!

0 Upvotes