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

login

Enqueue new login style sheet

Replace get_template_directory_uri(), that’s for your parent theme’s directory, with get_stylesheet_directory_uri() since you want to target the file within the child theme’s directory. Or better yet, just use get_theme_file_uri( ‘login_styles.css’ ) if you want to search for it, first in the child theme’s directory, else in the parent theme’s directory.

Categories login Tags login, wp-enqueue-style

Changed the url into https and now can’t access site admin

Update your wp-config.php with following lines: define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); Where example.com your domain

Categories login Tags http, login

How to password-protect everything except the logo

Redirecting web pages You can save yourself adding code to all templates in your theme by hooking this in instead. function wpse299924_redirect() { if( !is_user_logged_in() ) { wp_redirect( wp_login_url() ); die; } } add_action( ‘template_redirect’, ‘wpse299924_redirect’ ); You’re right that your images and other media will still be accessible to anyone who knows the URL, … Read more

Categories login Tags login, password

How can I redirect wp-login.php but still allow logout and other actions?

Apparently after 2 days of trying to sort this out, all I needed to do was post here and then the solution would turn up so I could feel like an idiot. 🙂 I was able to tweak the response in this question (Disable Or Redirect WP-login.php) and finally get this to work. If anyone … Read more

Categories login Tags login

Auto login after reset password

$rp_cookie and $rp_path are inside a function but are not initialized inside the function so they are out of scope and thus, empty. You can try calling global $rp_cookie, $rp_path; at the start of your function but I don’t know if those variables have been set at the time your function is running and thus … Read more

Categories login Tags login

How can I prevent anyone from logging into a WordPress failover site?

One sure-fire, yet simple, method is to scramble the AUTH_KEY constant in the wp-config.php file on the backup server. In wp-config.php, change your AUTH_KEY line to append rand(). Example: define(‘AUTH_KEY’, ‘YOUR-SUPER-SECURE-GENERATED-KEY’ . rand()); On every page, the logged-in key is altered. This prevents users from staying logged in. Note: rand() is very insecure. But we’re … Read more

Categories login Tags backup, login

Keep user session with custom implementation of user login

wp_signon() actually already calls wp_set_auth_cookie() which is the function that sets the “remember me” cookie, hence you don’t need to manually call that function. And that (wp_set_auth_cookie($user->ID)) is actually the problem in your code, because it’s overwriting the “remember me” cookie that was already set.

Categories login Tags login

Lock out all WordPress Administrators except two specific users

|| means OR. Your code will never allow $current_user to proceed because one of the OR conditions will fail. Try using AND && instead: if ( ($current_user->user_login != ‘john’) && ($current_user->user_login != ‘sheila’ ) ) {

Categories login Tags login, logout, user-roles, username

Redirecting after login?

I’m going to venture a guess here, and maybe someone more versed can back me up or set me straight But here: <?php echo htmlspecialchars($_SERVER[‘REQUEST_URI’])?>’ Is the redirect value…. It is redirecting to the original url, wherever the user came from If you swap that out for your home url with something like: <?php echo … Read more

Categories login Tags forms, login

User needs to login first before accessing website

You can use the following action to redirect all traffic to that login page. You will need to specify the page name and the page slug. add_action(‘wp’, ‘wpse_41699_wp’, 0); function wpse_41699_wp(){ if(is_page(‘Login’)) return; if(!is_user_logged_in()){ $url = get_bloginfo(‘home’).’/login’; header(‘HTTP/1.1 403 Forbidden’); header(“Location: $url”); exit; } } Also, you can download the plugin version for this answer … Read more

Categories login Tags login
Older posts
Newer posts
← Previous Page1 … Page42 Page43 Page44 … Page75 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
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 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