Home Forums Themes Support Formota How do I change the text for the comment title 'Leave us a comment'?

This topic contains 3 replies, has 2 voices, and was last updated by  admin 2 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2825

    Hi,

    I am using the theme to create a website for one person. They would like the comment title to read ‘Leave me a comment’ instead of ‘Leave us a comment’.

    Looking forward to receiving your feedback.

    Kind regards,

    Attachments:
    You must be logged in to view attached files.
    #2827

    Hi,
    Thanks for contacting us and choosing our product!
    About your question you can change it in:
    Step 1: go to wp-content/themes/formota/framework/includes/ then open file theme-hooks.php
    Step 2: Go to line 234 you will see comment form. You will see the text on line 269
    http://prntscr.com/mnlyqn
    Hope this help!

    *****
    Best regards,
    HaruTheme

    #2879

    Hi, thanks for your reply.
    Please tell me, what happens when there is an update for the theme? Will this change be undone?

    Thanks again…

    #2880

    Hi,
    If you edit direct in this function it will lose when update our theme.
    The solution you can use child theme follow this topic tutorial:

    How to customize WordPress theme using Child theme


    You need to customize wp-content/themes/formota/templates/comments.php
    On line 52 you will see function haru_comment_form
    You can change to other function like: haru_comment_form_new
    In file functions.php of child theme you can create new function like this:
    http://prntscr.com/mr9288
    and

    if ( !function_exists('haru_comment_form_new') ) {
        function haru_comment_form_new( $args = array(), $post_id = null ) {
            global $id;
            $user = wp_get_current_user();
            $user_identity = $user->exists() ? $user->display_name : '';
    
            if ( null === $post_id ) {
                $post_id = $id;
            }
            else {
                $id = $post_id;
            }
    
            if ( comments_open( $post_id ) ) :
            ?>
            <div id="respond-wrapper">
                <?php
                    $commenter = wp_get_current_commenter();
                    $req       = get_option( 'require_name_email' );
                    $aria_req  = ( $req ? " aria-required='true'" : '' );
                    $fields    =  array(
                        'author'        => '<div class="row"><p class="comment-form-author col-sm-6 col-xs-12"><input id="author" name="author" type="text" placeholder="' . esc_attr__( 'Enter Your Name*', 'pangja' ) . '" class="form-control" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
                        'email'         => '<p class="comment-form-email col-sm-6 col-xs-12"><input id="email" name="email" type="text" placeholder="' . esc_attr__( 'Enter Your Email*', 'pangja' ) . '" class="form-control" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
                        'comment_field' => '<div class="col-sm-12"><p class="comment-form-comment"><textarea class="form-control" placeholder="' . esc_attr__( 'Enter Your Comment', 'pangja' ) . '" id="comment" name="comment" cols="40" rows="6" aria-required="true"></textarea></p></div></div>'
                    );
                    $comments_args = array(
                            'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
                            'logged_in_as'         => '<p class="logged-in-as">' .
                            sprintf(
                            __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s">Log out?</a>', 'pangja' ),
                              admin_url( 'profile.php' ),
                              $user_identity,
                              wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) )
                            ) . '</p>',
                            'title_reply'          => '<span>'. esc_html__( 'Leave us ', 'pangja' ) .'</span>' . esc_html__( 'a comment', 'pangja' ),
                            'title_reply_to'       => esc_html__( 'Leave a reply to %s', 'pangja' ),
                            'cancel_reply_link'    => esc_html__( 'Click here to cancel the reply', 'pangja' ),
                            'comment_notes_before' => '',
                            'comment_notes_after'  => '',
                            'label_submit'         => esc_html__( 'Post Comment', 'pangja' ),
                            'comment_field'        => '',
                            'must_log_in'          => ''
                    );
                    if ( is_user_logged_in() ) {
                        $comments_args['comment_field'] = '<p class="comment-form-comment"><textarea class="form-control" placeholder="' . esc_attr__( 'Enter Your Comment', 'pangja' ) . '" id="comment" name="comment" cols="40" rows="6" aria-required="true"></textarea></p>';
                    }
                    comment_form($comments_args);
                ?>
            </div>
    
            <?php
            endif;
        }
    }

    Hope this help!

    *****
    Best regards,
    HaruTheme

    • This reply was modified 2 months, 3 weeks ago by  admin.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.