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.

How can I completly rewrite the markup of the login page in wordpress? I dont want to just change labels or the logo... I need to completly rewrite the structure of the page.

Thanks ahead!

share|improve this question
1  
Have you seen this? –  brasofilo Jul 7 '13 at 10:06
add comment

2 Answers

It's not a good idea to customize directly the login page because it contains lots of important mechanisms that is better to keep working.

Even the plugins that customize the login page (A5 Custom Login Page and Custom Login for example) don't let you change the semantic structure of the page, but just take action to some graphic elements (colors, background, etc.)

So I would suggest you to change your login page via css, using the classes and the identifiers defined by wordpress and listed in the Customizing the Login Form page:

body.login {}
body.login div#login {}
body.login div#login h1 {}
body.login div#login h1 a {}
body.login div#login form#loginform {}
body.login div#login form#loginform p {}
body.login div#login form#loginform p label {}
body.login div#login form#loginform input {}
body.login div#login form#loginform input#user_login {}
body.login div#login form#loginform input#user_pass {}
body.login div#login form#loginform p.forgetmenot {}
body.login div#login form#loginform p.forgetmenot input#rememberme {}
body.login div#login form#loginform p.submit {}
body.login div#login form#loginform p.submit input#wp-submit {}
body.login div#login p#nav {}
body.login div#login p#nav a {}
body.login div#login p#backtoblog {}
body.login div#login p#backtoblog a {}

If all this still does not distract you from your purpose, you can always change the file wp-login.php into your root (I repeat: don't do it!)

share|improve this answer
add comment

If you want change completely the login page, it's better create another login page:

  1. create a page template with your customized login form and what else you want.
  2. in WP admin create a page, title it "Login Page" and assign the template created at 1.
  3. in functions.php put following code to redirect user to your login page:

    function my_login_redirect() {
      $loginpage = get_page_by_title('Login Page');
      global $pagenow;
      if ( $loginpage && ('wp-login.php' == $pagenow) ) {
         wp_redirect( get_permalink($loginpage) );
         exit;
      }
    }
    add_action('init', 'my_login_redirect');
    

Of course your page template must implement all the logic for authenticate users, logout them and remember password. But looking at the code of wp-login.php in the root folder of WP will sure help you in this job.

share|improve this answer
add comment

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.