- This topic has 7 replies, 2 voices, and was last updated 4 years, 3 months ago by .
Show Last Updated on Posts
You must be logged in to reply to this topic.
Hello Guys,
I’m trying to make my articles show last updated time, instead of showing just when it was published alone. Can you please tell me what to edit in the code line below and what to replace it with? Thank you.
function verb_lite_posted_on() {
$time_string = ‘<time class=”entry-date published updated” datetime=”%1$s”>%2$s</time>’;
if ( get_the_time( ‘U’ ) !== get_the_modified_time( ‘U’ ) ) {
$time_string = ‘<time class=”entry-date published” datetime=”%1$s”>%2$s</time>’;
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( ‘c’ ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
_x( ‘on %s’, ‘post date’, ‘verb-lite’ ),
” . $time_string . ”
);
$byline = sprintf(
_x( ‘ %s’, ‘post author’, ‘verb-lite’ ),
‘<span class=”author vcard”>‘ . get_avatar( esc_attr(get_the_author_meta(‘user_email’)), ’24’, ” ) . ‘ ‘ . esc_html( get_the_author() ) . ‘</span>’
);
echo ‘<span class=”byline”> ‘ . $byline . ‘</span> <span class=”posted-on”>’ . $posted_on . ‘</span>’;
}
endif;
Hello,
On line 167, change
_x( 'on %s', 'post date', 'verb-lite' ),
to
_x( 'on %s', 'modified date', 'verb-lite' ),
If that doesn’t work, let me know.
Hi Hans,
Thanks for replying.
It didn’t work, no changes was effected.
Ok, can you provide me with admin access to your site so I can log in and have a look?
Select set as private reply when responding.
I’m sort of concerned as to granting admin access for security reasons. Can you please look into the code again?
Hello,
I’m going to need to test different things in the code so it is much easier for me to log in.
We’ve done this hundreds of time for other clients so please don’t be concerned.
I promised we won’t break anything.
You can also add me as an Admin user by going to the Users tabs in the Admin Dashboard and creating a new user with my email [email protected].
Then the system will email be a secure password.
You must be logged in to reply to this topic.