Move reCaptcha To Below "Review Text"

I have just added a reCaptcha to WP Review Pro. Unfortunately it is in the wrong place. It is ABOVE "Review Text". It should be BELOW "Review Text".

Can you tell me please how to move it down?
Support Access is granted.
Thank you.

  • Adam Czajczyk

    Hello Mary,

    I hope you're well today and thank you for your question!

    I checked the captcha with GeneratePress theme and and checked captcha plugin docs and it looks like the captcha is hooking to a filter that's called out before the comment form.

    I tried to move it down but the way they suggest in captcha plugin documentation, doesn't seem to work with GeneratePress theme. However, I have tested this with a clean setup only and with default comment form so that's not a conclusive answer yet :slight_smile:

    I have accessed your site but I'm not sure where should I look for to see that captcha displayed the way you described. Can you please point me to an example post/page so I could see it? I hope I'll be then able to find a workaround.

    Best regards,
    Adam

  • Adam Czajczyk

    Hello Mary!

    Thank you for this explanation. I thought that would be this but wasn't sure.

    I experimented with this a bit more and I couldn't fine a way to move the Captcha between the "Review Text" text box and "Post Review" submit button but I was able to move it right below the "Post Review" (Post Comment in my case) box).

    To do this, please follow these steps:

    1. copy the "comments.php" file from GeneratePress parent theme folder to the GeneratePress child theme folder
    2. edit the "comments.php" file in child theme folder with clean text editor and look for this code:

    $defaults = array(
    		'fields'		=> apply_filters( 'comment_form_default_fields', $fields ),
    		'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
    		'must_log_in' 	=> '<p class="must-log-in">' .  sprintf( __( 'You must be <a href="%1$s">logged in</a> to post a comment.','generatepress' ), wp_login_url( get_permalink() ) ) . '</p>',
    		'logged_in_as'	=> '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" class="comment-logout" title="Log out of this account">Log out?</a>','generatepress' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( get_permalink() ) ) . '</p>',
    		'comment_notes_before' => null,
    		'comment_notes_after'  => null,
    		'id_form'              => 'commentform',
    		'id_submit'            => 'submit',
    		'title_reply'          => apply_filters( 'generate_leave_comment', __( 'Leave a Comment','generatepress' ) ),
    		'title_reply_to'       => apply_filters( 'generate_leave_reply', __( 'Leave a Reply to %s','generatepress' ) ),
    		'cancel_reply_link'    => apply_filters( 'generate_cancel_reply', __( 'Cancel reply','generatepress' ) ),
    		'label_submit'         => apply_filters( 'generate_post_comment', __( 'Post Comment','generatepress' ) ),
    	);
    
    	comment_form($defaults);

    3. replace that code with this one:

    $defaults = array(
    		'fields'		=> apply_filters( 'comment_form_default_fields', $fields ),
    		'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
    		'must_log_in' 	=> '<p class="must-log-in">' .  sprintf( __( 'You must be <a href="%1$s">logged in</a> to post a comment.','generatepress' ), wp_login_url( get_permalink() ) ) . '</p>',
    		'logged_in_as'	=> '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" class="comment-logout" title="Log out of this account">Log out?</a>','generatepress' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( get_permalink() ) ) . '</p>',
    		'comment_notes_before' => null,
    		'comment_notes_after'  => null,
    		'id_form'              => 'commentform',
    		'id_submit'            => 'submit',
    		'title_reply'          => apply_filters( 'generate_leave_comment', __( 'Leave a Comment','generatepress' ) ),
    		'title_reply_to'       => apply_filters( 'generate_leave_reply', __( 'Leave a Reply to %s','generatepress' ) ),
    		'cancel_reply_link'    => apply_filters( 'generate_cancel_reply', __( 'Cancel reply','generatepress' ) ),
    		'label_submit'         => apply_filters( 'generate_post_comment', __( 'Post Comment','generatepress' ) ),
    	);
    
    	remove_action( 'comment_form_after_fields', 'gglcptch_commentform_display' );
    	remove_action( 'comment_form_logged_in_after', 'gglcptch_commentform_display' );
    	add_action( 'comment_form', 'gglcptch_commentform_display' );
    
    	comment_form($defaults);

    That should do the trick.

    Best regards,
    Adam