I’m getting this syntax error: Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ on line 18 on this page.
I think it’s the ‘first published’ line that could be the problem. Any suggestions?
Thanks – Tara
<?php
$days = round((date('U') - get_the_time('U')) / (60*60*24));
if ($days==0) {
echo "Published today |";
}
elseif ($days==1) {
echo "Published yesterday |";
}
else {
echo "First published " the_time('F - j - Y') " |";
}
?>
Last updated at <?php the_time('g:i a'); ?> on <?php the_time('l, F jS, Y') ?> by <?php the_author(); ?>
Your issue is this:
The other answers that suggest concatenation are all wrong. the_time(), in WordPress, will echo, so you need to split this in multiple calls:
Alternatively, concatenate but using get_the_time():