Blog entry by newest (date)

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 18, 2008   (RSS)

By soj - April 17, 2008

How might I display only the latest blog entry in, say, my index.php (as opposed to the pageList.php, etc)?

Would the following or some version of work?

$options['where'] = 'fieldname = 'date DESC';

TIA! soj

Re: [soj] Blog entry by newest (date)

By Dave - April 18, 2008

Close, you don't need the fieldname = part though. So it looks like this, and if you only want the latest (1 entry) we'll add a setting for that as well:

$options['orderBy'] = 'date DESC';
$options['perPage'] = '1'; // show 1 record
$options['pageNum'] = '1'; // from first page only
$options['where'] = '1'; // to ignore search options


Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com