Can I list latest post differently?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 4, 2010   (RSS)

Re: [jonoc73] Can I list latest post differently?

By Jason - June 4, 2010

Hi Jono,

What you can do is set a variable that get changed after the first posting. This way you can always tell if you're outputting the first record or not.

It would look something like this:

<?php $firstRecord=true; ?>
<?php foreach($blogRecords as $blog): ?>
<?php if($firstRecord):?>
<?php $firstRecord=false; ?>
*OUTPUT LATEST RECORD*
<?php else: ?>
*OUTPUT REGULAR RECORD*
<?php endif ?>

<?php endforeach?>


As long as you're returning the latest post as your first record, this will work.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Can I list latest post differently?

By (Deleted User) - June 4, 2010

As usual - FANTASTIC and works like a charm!

Thank you Jason