Login Page Wordpress

Asked

Viewed 53 times

-2

I’m trying to create a login page without being that of wp-admin, I want to create a custom,and I can’t use plugin, some tip or example of how to do this?

1 answer

1


Buddy, I already did it once and it was that way down:

<?php 
global $user_login;

        // Login form arguments. 'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
        $args = array(
            'echo'           => true,
            'redirect'       => home_url( '/meu-painel/' ),
            'form_id'        => 'loginform',
            'label_username' => __( 'Username' ),
            'label_password' => __( 'Password' ),
            'label_remember' => __( 'Remember Me' ),
            'label_log_in'   => __( 'Log In' ),
            'id_username'    => 'user_login2',
            'id_password'    => 'user_pass2',
            'id_remember'    => 'rememberme',
            'id_submit'      => 'wp-submit',
            'remember'       => true,
            'value_username' => NULL,
            'value_remember' => true
        ); 

        // Calling the login form.
        wp_login_form( $args );
     ?>

Just enter this code where you want it in the template. Then you would only have to deal with the validation issue in case of an error.

See that, after login, set the redirect (redirect) to the page "My dashboard".

I hope it helps you!

  • This solution I had already seen, let me explain a little better my problem,I created a custom_post_type, and added a login menu in the wordpress panel, what I want is for future users of my system to log in by the login page I created and the login is not taking data from wp-admin but from my login menu in the wordpress panel

  • Wait there that got confused a little bit. The guy will already be logged in to the wp standard, correct? So you want users to log in for a second time to access a particular environment? That’s it?

  • Not exactly, it would be like this, the person would enter in http://example.com and appear the login screen that I created there it would type in her login, but the point is that I do not want the login to come from wordpress, as would be the normal to enter users and create a user for it and such, and yes that the data I would compare would be for the login menu I created on the wordpress panel, understand? basically I want to replace where the information comes from to enter the system, from users to that login I created

  • I get it. Dude, in this case you’ll have to develop a separate program. From what I see, it’s not a simple thing. Type will have to create tables in the database to store the user data and then go for coding. For me, I had never seen this situation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.