[wp-hackers] Displaying date on archive pages

Harish Narayanan harish.mlists at gmail.com
Fri Dec 26 18:03:30 GMT 2008


RePost wrote:
>> <?php /* If this is a daily archive */ } if (is_day()) { ?>
>> <h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
>>
>> <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
>> <h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
>>
>> <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
>> <h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
>>   
> Thanks, Harish.
> 
> This returns an "unexpected '}' error" for the first line.

I apologise, I hastily copied and pasted it from my old theme.

Just remove the first } and add it to the end of the final elseif and it
should be OK.

Harish


More information about the wp-hackers mailing list