This topic has 10 replies, 2 voices, and was last updated 9 years by sharmstr.

  • Author
  • #39642
     lovewp
    Participant

    @Abe Question, where would I find “childs function.php file” so I can input the following code from @sharmstr

    function kleo_ajax_login()
    {
    // Check the nonce, if it fails the function will break
    check_ajax_referer( ‘kleo-ajax-login-nonce’, ‘security’ );

    // Nonce is checked, get the POST data and sign in user
    $info = array();
    $info[‘user_login’] = $_POST[‘log’];
    $info[‘user_password’] = $_POST[‘pwd’];
    $info[‘remember’] = (isset( $_POST[‘remember’] ) && $_POST[‘remember’] === true) ? true : false ;

    $info = apply_filters(‘kleo_ajaxlogin_atts’, $info);

    $user_signon = wp_signon( $info, false );
    if ( is_wp_error($user_signon) ){
    echo json_encode(array( ‘loggedin’ => false, ‘message’ => ‘<span class=”wrong-response”><i class=”icon icon-attention”></i> ‘ . __( ‘Wrong username or password. Please try again.’, ‘kleo_framework’ ) . ‘</span>’ ));
    } else {
    if ( sq_option( ‘login_redirect’ , ‘default’ ) == ‘reload’ ) {
    $redirecturl = apply_filters( ‘login_redirect’, ‘/activity’, ”, $user_signon );;
    }
    else {
    $redirecturl = apply_filters( ‘login_redirect’, ”, ”, $user_signon );
    }

    echo json_encode(array(‘loggedin’=>true, ‘redirecturl’ => $redirecturl, ‘message’=> ‘<span class=”good-response”><i class=”icon icon-ok-circled”></i> ‘ . __( ‘Login successful, redirecting…’,’kleo_framework’ ) . ‘</span>’ ));
    }

    die();
    }

    #39651
     sharmstr
    Moderator

    themes/kleo-child/functions.php

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #40763
     lovewp
    Participant
    This reply has been set as private.
    #40764
     lovewp
    Participant

    @Abe Can you please tell me how to get your child theme to work, I have the folder inside of themes, it contains your functions and style files, I’m doing something wrong, I cannot get the above code to function, I don’t think it’s even being seen, please help me out.

    Thanks.

    #40765
     lovewp
    Participant
    This reply has been set as private.
    #40780
     sharmstr
    Moderator

    If you just copied the code from above it wont work. There are are left and right single quote characters. You need to change all of those to regular quote characters.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #40809
     lovewp
    Participant
    This reply has been set as private.
    #40810
     lovewp
    Participant
    This reply has been set as private.
    #40812
     sharmstr
    Moderator

    Delete the code in your childs function file

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #40814
     lovewp
    Participant
    This reply has been set as private.
    #41032
     sharmstr
    Moderator

    “Why would I delete it?” Because you said you didnt think it was reading your childs function.php file. If you delete it and dont get the error, then you would have proven to yourself that it was reading that file. We already knew it was, I was trying to get you to believe that.

    Now, for the code you have pasted in here, please re-paste with with pre tags around it so it doesnt covert the single quotes to fancy quotes.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?