Forum

Thread tagged as: Problem, Blog

perch_blog_custom 'start' not working

Hello again. currently I have a problem where 'start' does not affect the results of perch_blog_custom()

<?php
perch_blog_custom(array(
     'template' => 'post_in_list.html',
     'sort' => 'postDateTime',
     'sort-order' => 'DESC',
     'count' => 10,
));

// This does the same as below

perch_blog_custom(array(
     'template' => 'post_in_list.html',
     'sort' => 'postDateTime',
     'sort-order' => 'DESC',
     'count' => 10,
     'start' => 3,
));
?>
Nicholas Nelson

Nicholas Nelson 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Does it make a difference if you disable pagination?

Huh, yeah that seamed to do the trick.

Thanks you!

I thought that start doesn’t work when sorting is enabled, but disabling pagination did the trick. My use case is displaying the latest blog post completely on my home page, and then the three behind that, using two different perch_blog_custom functions, each using a different template. Without adding an item offset to the second using start, the latest post would be displayed twice.

I didn't see that pagination was indicated in the original perch blog custom code. What do you mean by "disable pagination"?