WordPress.org

Ready to get started?Download WordPress

Plugin Directory

SimpleModal Login

SimpleModal Login provides a modal Ajax login, registration, and password reset feature for WordPress which utilizes jQuery and the SimpleModal jQuery

How can I redirect back to the current page after login?

The WordPress wp_loginout() function allows for an optional $redirect parameter which is the URL where the user will be sent after a logging in our logging out.

To have the user return to the page they were on, update the code to look like:

<?php wp_loginout($_SERVER['REQUEST_URI']); ?>

If you are using the Meta Widget (Appearance > Widgets), to use this feature, you may need to delete the Meta Widget and add the code to your sidebar.php file manually.

For example, after you delete the Meta Widget, open sidebar.php (in your theme) and add[1] the following code:

<ul>
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>
</ul>

[1] Place it wherever you'd like to display and modify the code to fit your needs.

Lastly, if you've manually added a log in link, you can change it to:

<a href="/wp-login.php?redirect_to=<?php echo $_SERVER['REQUEST_URI']; ?>" class="simplemodal-login">Log In</a>

How can I create my own custom theme?

This is for users familiar with CSS and JavaScript, namely jQuery and SimpleModal.

To create a new theme you'll need to add two files under the simplemodal-login plugin directory: css/THEME.css and js/THEME.js. Replace THEME with the name you would like to use.

I suggest copying one of the existing themes as a template to start with.

How can I modify the form HTML?

This is an advanced option for users familiar with HTML, PHP and WordPress.

Starting with SimpleModal Login 1.0, each form (login, register, password reset) has a filter available that allows you to modify the HTML.

The 3 available filters are:

  • simplemodal_login_form
  • simplemodal_registration_form
  • simplemodal_reset_form

To use the filter, you'll need to add code to your theme's functions.php file. For example:

add_filter('simplemodal_login_form', 'mytheme_login_form');
function mytheme_login_form($form) {
    // $form contains the SimpleModal Login login HTML

    // do stuff here

    // you have to return the code that you want displayed
    return $form;
}

You'd probably want to start by copying the form HTML from the appropriate function in the main plugin file and then modifying to fit your requirements.

Things you'll need to change:

  1. Change $this->users_can_register (for login and reset forms only)
  • Create a $users_can_register variable in your function:

    $users_can_register = get_option('users_can_register') ? true : false;

  • Replace $this->users_can_register with $users_can_register

  1. Change $this->options['registration'] and $this->options['reset']
  • Create an $options variables in your function:

    $options = get_option('simplemodal_login_options');

  • Replace $this->options['registration'] with $options['registration']

  • Replace $this->options['reset'] with $options['reset']

Here are complete working examples for each of the three filters:

Can I remove the "Powered by SimpleModal Login" link?

Yup, see below. A donation is appreciated, but not required ;)

How can I remove the "Powered by SimpleModal Login" link?

Just add the following to your style.css file:

.simplemodal-login-credit {display:none;}

Have a question, comments or feature requests? Be sure to let me know.

Requires: 2.5.0 or higher
Compatible up to: 3.4.2
Last Updated: 2012-9-8
Downloads: 137,175

Ratings

4 stars
4.4 out of 5 stars

Support

0 of 3 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1 100,1,1
100,2,2 100,1,1
100,4,4 100,1,1 100,1,1 100,1,1
100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2
100,2,2 100,1,1 100,2,2 78,9,7 100,1,1 100,2,2
100,2,2 100,2,2 100,2,2
82,11,9
100,3,3
100,3,3
61,18,11
100,5,5
60,5,3
80,5,4
79,14,11
33,6,2
75,8,6
0,3,0
100,1,1
83,6,5 100,1,1 100,3,3
89,9,8
100,2,2
71,7,5
100,2,2
0,1,0
100,1,1
100,1,1
50,2,1