Forum
Pagination Issue with Blog
I'm having issues getting pagination working with the Blog add on.
I have the following code and this display pagination but when clicked the page changes but the articles do not update?
I also need to display all articles but when I remove the count the pagination doesn't display?
Any guidance would be great?
Thanks
Post.php
This is at the top of the template
This is at the top of the template
<?php
$post_slug = perch_get('s');
?>
<h1><?php perch_blog_post_field($post_slug, 'postTitle'); ?></h1>
<?php perch_blog_post_field($post_slug, 'postDescHTML'); ?>
<?php
perch_blog_custom(array(
'template' => 'in-pagination.html',
'paginate' => true,
'count' => 2,
));
?>
In-pagination.html
<perch:after>
<div class="post-finish-img post-inner-nav">
<perch:if exists="paging">
<perch:blog id="page_links" encode="false" />
<perch:if exists="not_first_page">
<div class="btn-container">
<a href="<perch:blog id="prev_url" encode="false" /> ">Previous</a>
</div>
</perch:if>
<perch:if exists="not_last_page">
<div class="btn-container">
<a href="<perch:blog id="next_url" encode="false" /> ">Next</a>
</div>
</perch:if>
</perch:if>
</div>
</perch:after>
Can you post your diagnostics report?
So you're paginating successfully, but your template doesn't output any posts.
Remove this:
and put the fields in your template instead.
It is in the template - posts.php is the template for the page
No, in the
insights-pagination.html
template.Any particular place (line of code) i should paste it in? I tossed it around and doesn't seem to fix the issue
Have you tried with the default templates?
No, But i could get it work with this: https://forum.grabaperch.com/forum/03-08-2015-generating-links-to-the-previous-and-next-blog-post and echo buttons in...