You can use “Captcha by BestWebSoft”” plugin, as described on faq page
https://wordpress.org/plugins/captcha/faq/
1. Install the Captcha plugin and activate it.
2. Open the file with the form (where you would like to add captcha to) – on that case it will be the file “login_afo_widget.php” (belongs to Login Widget With Shortcode plugin)
3. Insert the html code for the captcha output after line 112 = the password line:
after this line:
<li><input type="password" name="user_password" required="required"/></li>
add this code:
<?php if( function_exists( 'cptch_display_captcha_custom' ) ) {
echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />";
echo cptch_display_captcha_custom(); }
4. Add the following code inside the login validate function, on line 191, after the following code (and before else):
if($user->ID == ""){
$_SESSION['msg_class'] = 'error_wid_login';
$_SESSION['msg'] = __('Error in login!','lwa');
Add this:
} if( function_exists( 'cptch_check_custom_form' ) && cptch_check_custom_form() !== true ) {
$_SESSION['msg_class'] = 'error_wid_login';
$_SESSION['msg'] = __('Please complete the CAPTCHA!','lwa');
I’m not completely sure…
Maybe it could have been improved…
But it works for me, though.…
I hope that helps…
I forgot to add
<li></li>
& label
and to end the php on the form ?>
should be:
<li><label for="capcha">... your label ....</label></li>
<li><?php if( function_exists( 'cptch_display_captcha_custom' ) ) {
echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />";
echo cptch_display_captcha_custom(); } ?></li>
Thank you so much it work..
Thanks for your help..