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

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

Why can I log into wp-login.php and not wp-admin.php?

Because there is no wp-admin.php file in WordPress: You shouldn’t be able to login via wp-admin.php, it should not exist! Be extremely suspicious of this file, you may have been hacked, and have likely leaked your details to an attacker.

Categories wp-admin Tags login, wp-admin, wp-login-form

Does wordpress support natively the concept of logging-in users? (not admins, but users of the website)

Does wordpress support “consumer-users” natively? Or I must do it by means of a plugin? They’re just users, you don’t need to be able to edit pages to be logged in. In fact if you create a user, their default role doesn’t allow them to even see the pages and posts menus. All users in … Read more

Categories users Tags login, user-roles, users

Why am I locked out of the system?

If worpdress redirects you back to the login and password page (and not displaying any info that login/password was wrong), this is a sign that the login session is broken. Most often this is related to cookies. WordPress needs cookies for you to login. If cookies are not properly set or deleted later or are … Read more

Categories wp-admin Tags login, wp-admin

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

easy steps to make front end form without plugin

how can i display custom coded php form in only one page in front end? The best way to go would be to create a custom page template then create a page inside WordPress admin and select your newly created template for that page. how can i make that page ristricted for registered user only? … Read more

Categories plugins Tags forms, login, plugins, user-registration

Find out how many times the user has logged in

I don’t think so. You will need to do something like this (untested): add_action(“wp_login”, “my_login_function”); function my_login_function($username){ $userdata = get_user_by(‘login’, $username); $n = get_user_meta($userdata->ID, “my_login_counter”, true); if (! is_numeric($n)) $n = 0; $n = intval($n) + 1; update_user_meta($userdata->ID, “my_login_counter”, $n); }

Categories MySQL Tags login, mysql, users

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

Where is the query in wp-login.php

Look in wp-includes/general-template.php at the function wp_login_form(). Follow the functions called there. I’d say: just use wp_login_form(). It does probably everything you need, and you can customize it.

Categories query Tags login, query

Add logout link when logged in, make it disappear when logged out?

Try using wp_loginout(). It automatically handles those conditions.

Categories login Tags login, logout
Older posts
Newer posts
← Previous Page1 … Page91 Page92 Page93 … Page164 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