Styling WordPress login page – Can I change the markup on the login page?
WordPress has a Codex page on this exact subject: https://codex.wordpress.org/Customizing_the_Login_Form The Codex is always a good place to start!
WordPress has a Codex page on this exact subject: https://codex.wordpress.org/Customizing_the_Login_Form The Codex is always a good place to start!
if you want to check username and password fields, try below code if (isset($_POST[‘submit-btn’])) { $username = filter_var($_POST[‘username’], FILTER_SANITIZE_STRING); $password = filter_var($_POST[‘password’], FILTER_SANITIZE_STRING); if(empty($username)) { echo “Username empty”; return false; } if(empty($password)) { echo “Password empty”; return false; } if($username && $password) { $login_array = array(); $login_array[‘user_login’] = $username; $login_array[‘user_password’] = $password; $verify_user = wp_signon($login_array, … Read more
I don’t think it necessary to do the password checking inside wp_authenticate_user filter as that check is done as the next step inside wp_authenticate_email_password(), where the filter is defined. You can see this in wp-includes/user.php#L168. The filter parameter $user is either WP_User or WP_Error depending on if the user can be found with the username … Read more
You can enqueue styles for the login page with login_enqueue_scripts. Example: function themeslug_enqueue_style() { wp_enqueue_style( ‘loginStyles’, ‘login-style.css’, false ); } add_action( ‘login_enqueue_scripts’, ‘themeslug_enqueue_style’, 10 );
From the answer in Password protect a specific URL, we can reverse the condition. To quote his answer, You should be able to do this using the combination of mod_env and the Satisfy any directive. You can use SetEnvIf to check against the Request_URI, even if it’s not a physical path. You can then check … Read more
I believe you could use template_redirect to handle the redirect step: function my_page_template_redirect() { if ( !is_page( ‘overview’ ) && is_user_logged_in() ) { wp_redirect( home_url( ‘/thinkingmachines/overview/’ ) ); die; } } add_action( ‘template_redirect’, ‘my_page_template_redirect’ );
https://codex.wordpress.org/Customizing_the_Login_Form Check out the “Make a Custom Login Page” section. wp_register(”, ”); // Display “Site Admin” link. Replace this bit with a link to your custom registration page.
I am speculating here after reviewing your logic/comments above, yet let’s try as follows Possible issue: During login, although you are setting the auth cookie, you are not setting the current user and this is potentially the cause of the break-down upon logout due to is_user_logged_in returning a false-positive/negative result. Possible resolution: In your validation-room.php … Read more
Nested if/else/elseifs are usually too complex for me to figure out. I’d change your code to use SWITCH/CASE to determine proper input and to change the password if all is OK. And to sanitize $_POST (and $_GET) inputs, I just put this in my functions file: $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING); $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); Then … Read more
Just before any of the frontend template loads, WordPress fires an action – template_redirect. You can use this action hook to show SAML login if user isn’t logged in. This way, you won’t have to put the condition in every template file. // you can place this code in your theme’s functions.php file. add_action( ‘template_redirect’, … Read more