Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

wp-login-form

Moving from one host to another – cannot access the dashboard

Changing the AUTH_SALT (and SECURE_AUTH_SALT) from your wp-config.php should fix it

Categories login Tags hosting, login, migration, wp-login-form

Creating a custom login on site.

It depends on where your login script is. This is my testscript (saved as ìndex.php`): <html> <head> <title>Testform</title> </head> <body> <?php require_once ‘../wp-load.php’; var_dump($_COOKIE); if ( !( current_user_can(‘level_0′) ) ){ wp_login_form(); } else { ?> <ul> <li><a href=”https://wordpress.stackexchange.com/questions/58764/<?php echo home_url(“/wp-admin/’); ?>”>Admin</a></li> <li><a href=”<?php echo wp_logout_url( get_permalink() ); ?>”>Logout</a></li> </ul> <?php } ?> </body> I installed … Read more

Categories wp-login-form Tags wp-login-form

How to access the actual input html of the login form

There’s this basic trick: Close brackets, open again, insert what you need, close again. Real life example: $args = array( // some args for the login form ‘value_username’ => ‘User Name” onBlur=”whatever” onFocus=”anotherfoo’; ); wp_login_form( $args ); So we closed the brackets after the Username, then added our additional attributes and left the quotes open … Read more

Categories wp-login-form Tags wp-login-form

Show errormessages on wrong username/password on custom loginform?

Why do you not use the default function wp_login_form() for the login form, example: global $user_login; if (is_user_logged_in()) { echo __( ‘Hello’, ‘theme_text_domain’ ) . $user_login . ‘<a href=”‘ . wp_logout_url() . ‘” title=”‘ . __( ‘Logout’, ‘theme_text_domain’ ) . ‘”>’ . __( ‘Logout’, FB_BASIS_TEXTDOMAIN ) . ‘</a>’; } else { wp_login_form(); } the function … Read more

Categories functions Tags errors, functions, login, users, wp-login-form

Alert Message through email or phone(Message)

Successful log-ins trigger the action wp_login, failures wp_login_failed. Phone calls are not built-in, you need a separate plugin for that. Example with email: add_action( ‘wp_login_failed’, ‘wpse_79917_login_failed’ ); add_action( ‘wp_login’, ‘wpse_79917_login_success’, 10, 2 ); function wpse_79917_login_failed( $username ) { wp_mail( get_option( ‘admin_email’), ‘Login failed’, ‘custom message’ ); } function wpse_79917_login_success( $user_login, $user ) { wp_mail( get_option( … Read more

Categories login Tags login, wp-login-form

I lock the site’s contents, click on a post, redirect to login, enter uname+password but fail to redirect to article

You have to edit your redirect function to redirect back to the post where you were before redirection add_action( ‘template_redirect’, ‘login_to_see_content’ ); function login_to_see_content() { if ( is_singular() && ! is_user_logged_in() ) auth_redirect(); // does nothing for logged in users } to this add_action( ‘template_redirect’, ‘login_to_see_content’ ); function login_to_see_content(){ if(is_singular() && ! is_user_logged_in()){ $url= site_url().”/wp-login.php”; … Read more

Categories wp-login-form Tags wp-login-form

How can I redirect on a url after successful registration?

You used in_array wrong. There might be some redundancy in your function too(depending on what you’re doing). You could use something like this to redirect your users: add_filter(‘login_redirect’, ‘redirect_previous_page’, 10); function redirect_previous_page(){ global $user; if ( in_array( ‘administrator’, $user->roles ) ) { return admin_url(); } else { return ‘http://localhost/’; //add your link here } }

Categories wp-login-form Tags user-registration, wp-login-form

Cannot Get User id after login success in file wp_login.php

As said above modifying the core files is a bad idea, by doing so you are opening up security holes and on top of all this you loose the changes made on up-gradation. To do the above you can try the wp_login hook, put the codes in your active theme’s functions.php function after_login() { $current_user … Read more

Categories login Tags login, wp-login-form

WordPress hide the username/password fields in login page

If you are ready to do this with css, you can do it in the following clean way. Add the following code in the current theme’s functions.php file add_action( ‘login_head’, ‘wpse_121687_hide_login’ ); function wpse_121687_hide_login() { $style=””; $style .= ‘<style type=”text/css”>’; $style .= ‘.login form{ display: none }’; $style .= ‘.login #nav a, .login #backtoblog a … Read more

Categories CSS Tags css, wp-login-form

redirect doesn’t work while using example code

You can use the login_redirect filter to do this. One of the parameters is $request, which is the URL the user is coming from Use the below in your active theme’s functions.php file to make this work. function wpse126853_redirect_to_request( $redirect_to, $request, $user ) { // instead of using $redirect_to we’re redirecting back to $request return … Read more

Categories redirect Tags login, redirect, wp-login-form
Older posts
Newer posts
← Previous Page1 … Page14 Page15 Page16 … Page34 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress