Remove post title from comment entry

I found a post the other day that show me how to get rid of of the post title from the comment entry, so it just shows the number of comments without the added "on post title’ Though when upgrading to the pro edition I forget to backup my edited functions, and I can’t find out how to do it again. I’m using the renew stack.

Hi There,

Please add the following code under functions.php file locates in your child theme:

add_filter( 'ngettext', 'x_edit_renew_comment_title', 10, 5 );
function x_edit_renew_comment_title($translation, $single, $plural, $number, $domain){
	$translation = str_ireplace('One Comment on %2$s', 'One Comment', $translation);
	$translation = str_ireplace('%1$s Comments on %2$s', '%1$s Comments', $translation);
	return $translation;
}

Hope it helps :slight_smile:

Thank you very much

You’re most welcome :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.