0

I'm developing an intranet platform (so no external web access) and using the Password only login plugin.

I need to make a deep customization to the wp-login.php page:

  • the plugin i linked allows selected users to login with the password only. To do so it provides the pol_showform() function to be put where you want the custom login form (with password only) to appear;
  • as not all the user will be allowed to login with password only, i will need to keep the "classic login form". To do so i want to transform the "classic login form" adding a jQuery tab: in the first tab there will be the "password only login" (generated by the pol_showform() function), in the second tab there will be the "classic login form".

Now, i searched the web with no success for a way to override the wp-login.php page in my child theme. I know it's not a good idea, but it seems the only way to achieve what i need is to edit directly the wp-login.php file? Any alternative?

UPDATE

Found this Example2 that could solve the situation. The code in the example contains some errors (such as the echo $our_content when tha variable is $your_content) which is a little bit sad for an official documentation.

Anyway, problem is that there are paragraph added after the page has loaded and so the ob_get_contents() doesn't capture them. This piece of HTML is composed by the following paragraphs:

<p class="forgetmenot">[...]</p>
<p class="submit">[...]</p>
<p id="nav"></p>
<script type="text/javascript">
    function wp_attempt_focus(){
        [...]
    }
</script>
<p id="backtoblog"></p>
<div class="clear"></div>

Anyone knows hot to dequee them? Or how to fetch them in the ob_get_contents()? Is there any hook that fires after the whole page has been cached?

  • You'd be better off creating the complete custom login form with shortcode/custom page template at host/custom-login, POST to the default login page to handle, and then use the various redirect filters & actions in wp-login.php to push back to your page. – TheDeadMedic Feb 27 '15 at 12:15
  • @TheDeadMedic thanks for your suggestion. I found a possible partial solution and updated the question. If you could help me any further. – Mariano Feb 27 '15 at 14:27
0

You can edit the login form from your child themes functions.php using actions such as:

function my_login_scripts() {
    //do stuff here
}

add_action( 'login_enqueue_scripts', 'my_login_scripts' );

This should at least allow you to get your jQuery running on the page.

You can read more about this here: http://codex.wordpress.org/Customizing_the_Login_Form

| improve this answer | |
  • thanks, i've already read that page. I maybe found a system with this Example2. I've updated my question if you could help me any further. – Mariano Feb 27 '15 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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