Forum

Thread tagged as: Question, Blog

Perch Blog latest story

Hi,

I am working on the blog home page, and would like a layout displaying the latest post in full, followed by an excerpt list. I have the following:


<h2>News</h2> <h3>Latest Story</h3> <?php perch_blog_custom(array( 'count' => 1, 'template' => 'post.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC', )); ?> <hr> <?php perch_blog_recent_posts(6); ?> <p><a href="archive.php">More posts</a></p>

Which is working great, but I would like to hide the latest post excerpt from the blog_recent_posts, as that is already being displayed in full at the top of the page. What is the best way of doing this?

Thanks

Mike

Mike Harrison

Mike Harrison 37 points

  • 7 years ago

Use

'start' => 2

Instead of

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

Hi Dexter,

Thanks for the reply.

I have tried that, which looks correct, but for some reason it is not working. It is showing the correct 'count' of post excerpts, but is still showing from the latest one.

Got it, needed to disable pagination to get the 'start' to work. Final code below if anyone is interested:


<?php perch_blog_custom(array( 'count' => 6, 'start' => 2, 'template' => 'post_in_list.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC', 'paginate' => false, )); ?>