• Resolved jsteiger

    (@jsteiger)


    Hello,

    I am new user with ACF, and I want active Recaptach on a form in my wordpress.

    I Add a field reCaptach in backoffice, the fiels is added an configured.

    In back, I show the filed and the logo “reCaptach” is showing in the right corner.

    But, in my front, the logo is not show. I thing that I must not add the good code in my front end …

    Can you help me ?

    My HTML Code in my front page:

    <?php echo the_field('recapatcha'); ?>
    
       <form class="form d-block" method="post">
    ... 
       </form> 

    And the config of recapatcha code:

                       array(
                            'key' => 'field_form_fields_recapatcha',
                            'label' => 'ReCAPATCHA',
                            'name' => 'recapatcha',
                            'type' => 'acfe_recaptcha',
                            'instructions' => 'AntiSpam pour le formulaire',
                            'required' => 0,
                            'conditional_logic' => 0,
                            'wrapper' => array(
                                'width' => '',
                                'class' => '',
                                'id' => '',
                            ),
                            'only_front' => 0,
                            'acfe_permissions' => '',
                            'version' => 'v3',
                            'v2_theme' => 'light',
                            'v2_size' => 'normal',
                            'site_key' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
                            'secret_key' => 'xxxxxxxxxxxxxhxxxxxxxxxxxxxxxxxxx',
                            'acfe_settings' => '',
                            'acfe_validate' => '',
                            'disabled' => 0,
                            'readonly' => 0,
                            'v3_hide_logo' => false,
                            'acfe_form' => true,
                        ),
      
    • This topic was modified 4 years, 2 months ago by jsteiger.
Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    I think you’re misinterpreting the get_field() function. This function retrieve the actual field value from the DB (the value that has been entered by the admin in the Admin Post Edit Page). This function isn’t used to actually “render” the field (what you’re trying to do). Also, the reCaptcha field is kind of special, as there is nothing to save so there is no value i DB, since the field is used as validation.

    Screenshot back-end: https://i.imgur.com/EnxbTf7.png
    Screenshot front-end: https://i.imgur.com/iG16Ums.png

    In order to “render” an ACF field in the front-end, you have to use the native ACF Form feature or the ACF Extended: Form module. Those features are very powerful, but you should familiarize yourself with them, as they will print the whole <form> element and fields HTML. See screenshot: https://i.imgur.com/V94urUM.png

    Hope it helps!

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Active ReCaptcha in front’ is closed to new replies.