Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #844654

    Used this code and it only dispays the white recpatcha box. Any way someone can show me how to use the dark them one? their are two choices with google and i cant see anywhere in this code to select that.

    Thank you in advance.

    function ava_custom_recaptcha(){
    ?>
    <script type=”text/javascript”>
    var createCaptcha = function() {
    var button = jQuery(“.avia_ajax_form .button”),
    parent = button.parent(“.form_element”);
    captcha = jQuery(“<p id=’reCAPTCHAV2′></p>”);

    button.attr(“disabled”, “disabled”);
    captcha.insertBefore(parent);
    };

    createCaptcha();

    var onloadCallback = function() {
    var publickey = ‘YOUR PUBLIC API KEY’;
    grecaptcha.render(‘reCAPTCHAV2’, {
    ‘sitekey’ : publickey,
    ‘callback’ : ‘onSuccessfullCallback’
    });
    };

    var onSuccessfullCallback = function() {
    jQuery(“input[type=submit]”).removeAttr(‘disabled’);
    };
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘ava_custom_recaptcha’);

    if(!function_exists(‘avia_register_reCAPTCHAV2_scripts’))
    {
    if(!is_admin()){
    add_action(‘wp_enqueue_scripts’, ‘avia_register_reCAPTCHAV2_scripts’);
    }

    function avia_register_reCAPTCHAV2_scripts()
    {
    $prefix = is_ssl() ? “https” : “http”;
    $api_url = $prefix.’://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit’;

    wp_register_script( ‘avia-google-reCAPTCHAV2-api’, $api_url, array(‘jquery’), NULL, true);
    wp_enqueue_script( ‘avia-google-reCAPTCHAV2-api’ );
    }
    }

    #844920

    i fixed it. I added

    ‘theme’ : ‘dark’,

    after ‘sitekey’ : publickey,

    #845114

    Hi,

    I’m glad you were able to get this fixed. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Added google recaptcha and need dark theme’ is closed to new replies.