Front-End Login using PHP
-
Hello all,
I’m trying my best to add a login box to the front-end of my site. Using plugins hasn’t worked well so far aesthetically.
My preferred method so far has been to install ExecPHP and paste code into the widget in the footer, which works ok.
Further to what I’ve done so far, I’d like to:
- Add “Register | Forgot your password?” links for non-logged in users
- Add a link to account management for logged in users
- Remove the “Remember Me” box entirely, as it doesn’t sit well with the theme
Would anyone be kind enough to help me out? My current code is below.
<?php if ( ! is_user_logged_in() ) { // Display WordPress login form: $args = array( 'redirect' => admin_url(), 'form_id' => 'loginform-custom', 'label_username' => __( 'Username' ), 'label_password' => __( 'Password' ), 'label_remember' => __( 'Remember Me' ), 'label_log_in' => __( 'Log In' ), 'remember' => true ); wp_login_form( $args ); } else { // If logged in: wp_loginout( home_url() ); // Display "Log Out" link. echo " | "; wp_register('', ''); // Display "Site Admin" link. } ?>Thanks,
Nick π
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
The topic ‘Front-End Login using PHP’ is closed to new replies.