Site logo

Archived topic

How to change comment form placeholders?

18 replies · Started by Paritosh Negi on April 5, 2018

Viewing posts 16–19 of 19

Hi all,

I tried the code and nothing has changed, is there something wrong with my code ?

add_filter( 'comment_form_default_fields', 'tu_adjust_comment_form_fields' );
function tu_adjust_comment_form_fields( $fields ) {
    return array(
        'author' => '<label for="author" class="screen-reader-text">' . esc_html__( 'Name', 'generatepress' ) . '</label><input placeholder="' . esc_attr__( 'Nama Lengkap', 'generatepress' ) . ' *" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" />',
        'email' => '<label for="email" class="screen-reader-text">' . esc_html__( 'Email', 'generatepress' ) . '</label><input placeholder="' . esc_attr__( 'Email Aktif', 'generatepress' ) . ' *" id="email" name="email" type="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" />',
    );
}

I apply it in https://panduanesia.com

Thanks Leo, it's work :)

No problem :)

This archived topic is closed to new replies.