Change Comment Form Title “Leave a comment” WordPress

Change Comment Form Title “Leave a comment” WordPress
4177 Views

comment_form_defaults filter allow to change comment form title “Leave a comment” to other custom text, filter comment_form_defaults help you to change it.

<?php
add_filter( 'comment_form_defaults', 'cxc_change_comment_heading_callback', 20 );

function cxc_change_comment_heading_callback( $defaults ){
	$defaults['title_reply'] = __('Leave a Reply', 'cxc-codexcoach');
	return $defaults;
}
?>

Code goes in function.php file of your active child theme (or active theme).

Was this article helpful?
YesNo

Leave a comment

Your email address will not be published. Required fields are marked *