Edit "Posted on" text without removing the date

Hi Movin !

I noticed that unlike “Read more”, “Posted on” doesn’t get translated when I change my website’s language through Settings > General > Site language.

Is there any way to edit this “Posted on” text in the entire site through custom CSS ? If it’s out of my capacity, how can I choose not to display “Posted on” while still displaying the date my blog post was posted on ?

Thanks in advance !

Guillaume

Hi Guillaume,

I hope you are well today and thank you for your question.

You can try achieving this by using the attached small plugin specially developed for you that contains following custom code.

function colorlib_change_translate_text( $translated_text, $text, $domain ) {
	if ( trim($translated_text) == 'Posted on' ) {
		$translated_text = 'Custom Posted on';
}
	return $translated_text;
}
add_filter( 'gettext', 'colorlib_change_translate_text', 20, 3 );

Please change the text ‘Custom Posted on’ in the above code to whatever you want to display in place of ‘Posted on’ text.

Best Regards,
Movin

Thank you so much for developing this code for me ! All the help you’ve given me is so valuable.

I’m a noob thuogh, so where exactly should I put this code you’ve shared ? :smiley:

Thanks again !

You have to extract the file colorlib-divilab-plugin.php from the shared zip file and edit the text in it then zip the modified file again and install that zip file as WordPress plugin installation described on the below pages.

https://www.siteground.com/tutorials/wordpress/wordpress_plugins.htm

https://codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation