Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Resolved] How to Modify Comment Form?

Home Forums Support [Resolved] How to Modify Comment Form?

Home Forums Support How to Modify Comment Form?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #522955
    Paritosh Negi

    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 πŸ™‚

    GeneratePress 2.0.2
    GP Premium 1.5.6
    #523836
    Paritosh Negi

    Bump!! Anyone?? πŸ™

    #523965
    Leo
    Staff
    Customer Support

    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/

    #524062
    Paritosh Negi

    Hum… it did nothing… πŸ™

    .comment-form #author, .comment-form #email {
        display: inline-block;
    }
    #524155
    Leo
    Staff
    Customer Support

    Hmm it should work.

    Can you link me a page with the CSS added?

    #524483
    Paritosh Negi

    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

    #524484
    Paritosh Negi

    how can I change placeholder?

    #524499
    Paritosh Negi

    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

    #524662
    Leo
    Staff
    Customer Support
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.