Blog Post Pagination

  • I'm not seeing the pagination appear in a list of blog posts. The code:

    PHP
    1. <?php
    2. perch_blog_custom([
    3. 'count' => 60,
    4. 'sort' => 'postDateTime',
    5. 'template' => 'blog/post_in_column.html',
    6. 'sort-order' => 'DESC',
    7. 'paginate' => true,
    8. ]); ?>
    9. <perch:template path="pagination/default.html" rescope="parent">
  • Hi.


    Sure, the pagination should go inside the blog/post_in_column.html template. You'd want to move your template to there at the end in between <perch:after></perch:after> tags so it renders after the count setting in the function is reached.


    You will also want to count lower to something like 5 or 10 so that you get pagination kicking in - basically it will split your posts into pages containing that many posts. 60 is way too much.


    The default sample in the app is thus but you can adapt it to whatever you want - including a template (if that is what you want) using the <perch:template path="blah"> tags.



    Hope this helps!


    Jon