0

i am developing a word press site. I want to make login page as suitable to homepage. I am using a plugin for customizing the login page

  • It might be easier to add a login box to a regular homepage e.g. using a login widget plugin. But I'd guess you can just call wp_head and wp_footer from your custom login page? – Rup Jul 1 at 11:02
2

If you have your site footer and masthead (e.g. including main menu, hero image, etc.) HTMLs as separate template files, you could bascially include them on the default login page like this,

add_action('login_head',function(){
    get_template_part( 'site-header' );
});

add_action('login_footer',function(){
    get_template_part( 'footer' );
});

I wouldn't use get_header and get_footer directly as they probably contain some extra opening and closing html tags (html,body..), which might cause weird results.

You'll need to enqueue your theme styles and scripts also,

add_action( 'login_enqueue_scripts', 'theme_styles_and_scripts_enqueue_function' );

You might also want to do some extra styling to make the login form look the way you want.

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.