I am using the zerif lite theme on my website.
I only need to change the text which says "Posted on" to "Last updated on". I can change the date manually using the wordpress editor.
I found out it has something to do with the content.php
and content-single.php
. However I have no idea what to do. Both of them have this code.
<div class="entry-meta">
<?php zerif_posted_on(); ?>
</div><!-- .entry-meta -->
Changing text in the above code to "last_updated" breaks the website, so I reverted it.
In template-tags.php
there is a code which looks like this
function zerif_posted_on() {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string .= '<time class="updated" datetime="%3$s">%4$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() )
);
printf( __( '<span class="posted-on">Posted on %1$s</span><span class="byline"> by %2$s</span>', 'zerif-lite' ),
sprintf( '<a href="%1$s" rel="bookmark">%2$s</a>',
esc_url( get_permalink() ),
$time_string
),
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
)
);
}
endif;
Can I change the text to last updated on here? Do I need custom code or can I just find a file where I change the text to "Last Updated on"?
Edit: I did changed the text from Posted on
to Last updated on
in the Template-tags.php
, nothing happened, it is still showing as Posted On.
So, I solved my own question. I needed to change this text "Posted on" to "last updated" in my parent theme. I copy pasted the template-tags.php in my child theme and tried to do it but it didn't changed the text.
From this,
To this,