Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1017807

    I want to rename “Leave a message” in comment section. I heard that we must copy the comment.php to child theme and change it. How to do that?

    #1018131

    Hey ezvisa,
    To copy the comment.php to child theme and change it, please add this code to the end of your child theme functions.php file in Appearance > Editor:

    function avia_include_shortcode_template($paths)
    {
    	$template_url = get_stylesheet_directory();
        	array_unshift($paths, $template_url.'/shortcodes/');
    
    	return $paths;
    }
    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);

    then create a folder “shortcodes” in your child theme directory and add your modified file there.

    Another option is to add this code to the end of your functions.php file in Appearance > Editor to change the text, but you must have jQuery enabled and loading in the head within the performance settings:

    function custom_comment_script(){
      ?>
      <script>
    jQuery(window).load(function(){   
      // Replace coments title to "Let me know your thoughts, leave a comment.". 
      jQuery(".single-post .miniheading").text("Let me know your thoughts, leave a comment.");
      // Replace sub-heading to "Please tell us more". 
      jQuery(".single-post .minitext").text("Please tell us more");      
      // Replace submit button text to "Post your Thoughts".
      jQuery(".single-post .submit").val("Post your Thoughts");
    });
     </script>
      <?php
      }
      add_action('wp_footer', 'custom_comment_script');

    2018-10-05_000642

    Best regards,
    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.