Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Display Date as week Re: Display Date as week

#58408
richtestani
Member

I’m not super versed in WordPress, but I would set a variable as a string, then during ‘the loop’, check for the first iteration, append the first date. The check for the last iteration and append that date.

Psudo code below


//loop
if($i == 0) {
$date_range = date('m d, Y', post_date());
}

if($i == num_posts()) {
$date .= '-'.date('m d, Y', post_date());
}

echo $date;

You will have to either have 2 loops on the page since this is something you’d only post once on the page.

Hope this is at least a direction.