Human Time Difference trouble
-
Hi all
New to PHP so I don’t know what I’m doing wrong here. I’m essentially trying to change the date format of each post so that it uses the human time difference function.
I’ve figured that the date information (cb_date ?) is built into core.php. This is the line that i’ve found:
$cb_date = ' <div class="cb-date cb-byline-element"><i class="fa fa-clock-o"></i> <time class="updated" datetime="' . get_the_time('Y-m-d', $cb_post_id) . '">' . date_i18n( get_option('date_format'), strtotime(get_the_time("Y-m-d", $cb_post_id )) ) . '</time></div>';I’ve tried adding in human_time_diff just before get_the_time, and i’ve tried pasting in
<?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?>which didn’t work. I get errors of ‘unexpected ;’ and if I delete the ; at the end of the line (which im sure is wrong), I get a T_STRING parse error.My website is http://www.thebookofbloke.com
I would be grateful if anybody could assist.
Thanks
The topic ‘Human Time Difference trouble’ is closed to new replies.