Site logo

Archived topic

How to Modify Comment Form?

8 replies · Started by Paritosh Negi on March 18, 2018

Viewing posts 1–9 of 9

Hello! I hope you are having a productive day.

I want to customize comment form of the GeneratePress.

This screenshot explains how I want to arrange the comment form: https://cdn.pbrd.co/images/HctL1LG.png

Also, how can I change placeholder?

Thank you so much :)

Bump!! Anyone?? :(

Hi there,

Sorry not sure how why we didn't receive a notification for this topic!

Try this CSS:

.comments-area input#url {
    display: none;
}
.comment-form #author, .comment-form #email {
    display: inline-block;
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Hum... it did nothing... :(

.comment-form #author, .comment-form #email {
    display: inline-block;
}

Hmm it should work.

Can you link me a page with the CSS added?

Hello, I used the following code and it worked as expected.

#author, #email, #url {
    background: #fff !important;
    color: #999;
    border: 1px solid #dfdfdf;
    outline: none;
    width: 30%;
}

.comment-form #author, .comment-form #email, .comment-form #url {
    display: inline-block;
}

.comment-form #author, .comment-form #email {
    margin-right: 4%;
}

PREVIEW: https://cdn.pbrd.co/images/HcMyK0D.png

how can I change placeholder?

I edited the comments.php file and made chnage to esc_attr__()

	$fields = array(
		'author' => '<label for="author" class="screen-reader-text">' . esc_html__( 'Name', 'generatepress' ) . '</label><input placeholder="' . esc_attr__( 'Your Real Name', '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 Address', 'generatepress' ) . ' *" id="email" name="email" type="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" />',
		'url' => '<label for="url" class="screen-reader-text">' . esc_html__( 'Website', 'generatepress' ) . '</label><input placeholder="' . esc_attr__( 'Your Website URL', 'generatepress' ) . '" id="url" name="url" type="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />',
	);

PREVIEW: http://prntscr.com/ittm44

Glad you figured out!

This archived topic is closed to new replies.