-
Author
-
December 18, 2014 at 21:37 #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();
}December 19, 2014 at 00:41 #39651sharmstr
Moderatorthemes/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 solutionDecember 31, 2014 at 07:44 #40763lovewp
Participant@sharmstr I don’t have that directory structure? Do I need to create it?
December 31, 2014 at 08:20 #40764lovewp
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.
December 31, 2014 at 08:48 #40765lovewp
ParticipantParse error: syntax error, unexpected T_CLASS, expecting ‘)’ in /functions.php on line 21
December 31, 2014 at 13:31 #40780sharmstr
ModeratorIf 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 solutionDecember 31, 2014 at 19:45 #40809lovewp
ParticipantThis thread isn’t closed? @sharmstr I fixed the characters, still no luck, my question is this, I don’t think it’s reading the functions.php file in the child theme at all, I don’t know how to set-up the child theme, I tried but kept getting errors.
December 31, 2014 at 19:50 #40810lovewp
ParticipantThis is the error I get.
Parse error: syntax error, unexpected T_STRING in /home/zeroni6/public_html/pdxhuddle.com/dev/wp-content/themes/pdxhuddle_child/functions.php on line 30
December 31, 2014 at 20:21 #40812sharmstr
ModeratorDelete 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 solutionDecember 31, 2014 at 21:04 #40814lovewp
Participant@sharmstr Delete your code? I’m trying to get it working, why would I delete it?
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();
}January 5, 2015 at 17:19 #41032sharmstr
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 -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.