Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a modal login and I also have a custom login page as well. modal login page is mostly being used for login, register, forgot password.

The problem is whenever you login by modal login page, it goes to custom login page. not login processing page. (you have to put username and password again on the custom login page)

is there anyway to go to login processing page from modal login page? (if the username, pwd are wrong, it should be going to custom login page)

I tried to put "/login" instead of "//echo wp_login_url(apply_filters('kleo_modal_login_redirect', '') );" on action value. /login page is the custom login page.

This is the source.

    <div id="login_panel" class="reveal-modal">
 <div class="row">
<div class="twelve columns">
  <h5><i class="icon-user icon-large"></i> <?php _e("SIGN INTO YOUR ACCOUNT", 'kleo_framework');?><?php if(get_option('users_can_register')) { ?> <span class="subheader right small-link"><a href="#" data-reveal-id="register_panel" class="radius secondary small button"><?php _e("CREATE NEW ACCOUNT", 'kleo_framework');?></a></span><?php } ?></h5>
</div>
  <form action="/login<?php //echo wp_login_url(apply_filters('kleo_modal_login_redirect', '')  ); ?>" id="login_form" name="login_form" method="post" class="clearfix">
  <div class="six columns">
    <input type="text" id="username" required name="log" class="inputbox" value="" placeholder="<?php _e("Username", 'kleo_framework');?>">
  </div>
  <div class="six columns">
    <input type="password" id="password" value="" required name="pwd" class="inputbox" placeholder="<?php _e("Password", 'kleo_framework');?>">
  </div>
  <p class="twelve columns">
    <small><i class="icon-lock"></i> Your <a target="_blank" href="<?php //if( sq_option('privacy_page', '#') != "#") echo get_permalink(sq_option('privacy_page')); else echo '#'; ?>"><?php _e("privacy", "kleo_framework");?></a> <?php _e("is important to us and we will never rent or sell your information.", "kleo_framework");?></small>
  </p>
  <div class="twelve columns">
    <button type="submit" id="login" name="submit" class="radius secondary button"><i class="icon-unlock"></i> &nbsp;<?php _e("LOG IN", 'kleo_framework');?></button> &nbsp; 
    <?php // do_action('fb_popup_button'); ?>
  </div>
</form>
<div class="twelve columns"><hr>
  <ul class="inline-list">
    <li><small><a href="#" data-reveal-id="forgot_panel"><?php _e("FORGOT YOUR USERNAME?", 'kleo_framework');?></a></small></li>
  </ul>
</div>

×

share|improve this question
    
Can you please explain what do you mean by modal login page? –  Maruti Mohanty Sep 23 '13 at 7:33
    
themeforest.net/item/sweet-date-more-than-a-wordpress-dating-theme/full_screen_p‌​review/4994573 please check this theme and click top of login, signup button. –  pulla Sep 23 '13 at 13:23

1 Answer 1

up vote 1 down vote accepted

Well actually I am not sure if it's the best way to go, but you could just combine what you are already doing into two steps. Have the form submit without the _parent target so that it stays in fancybox. But if login is a success, then use that auto-closing behavior that you mentioned by submitting another form to the _parent. I've not tried this, so I'm just going on trying to take advantage of the existing behavior you mentioned: Click Here

<?php

if($session->login($input->post->user, $input->post->pass)) {
    // login success

    if($user->isSuperuser()) $url = './';
        else $url = '/members/';     

    $out = "<form id='success' action='$url' target='_parent' method='get'>" . 
           "<input type='hidden' name='login' value='1' />" .
           "</form>" . 
           "<script>$(document).ready(function() { $('#success').submit(); }); </script>"; // submit the form
} else {
    // display error
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.