php - Change date format in wordpress to relative date -
need bit of here not familiar php. have 2 post type , 1 displaying date in "x time ago" format , 1 display traditional wordpress date format.
i found line in wordpress theme display traditional format on post.
$postheader .= '<abbr class="published" title="' . get_the_time('c') . '">' . get_the_time( get_option('date_format') ) . '</abbr></span>';
now theme has pre-written function display time in x minutes, days, weeks, years ago defined '%s' , it's being used in code below
<abbr class="published" title="<?php the_time('c') ?>"><?php printf( __('%s', 'arras'), arras_posted_on( false ) ) ?></abbr> | <a href="<?php comments_link() ?>"><?php comments_number() ?></a>
my question .. how modify first code display format in "x time ago" 1 being used in second code? tried paste exact same line , made page goes blank when reload.
try using code:
$postheader .= '<abbr class="published" title="' . arras_posted_on( false ) . '">' . arras_posted_on( false ) . '</abbr></span>';
Comments
Post a Comment