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

PHP If user is logged in & on home page redirect

First of all, home_url doesn’t provide anything. You should use the is_home() function instead. After that, you need to exit the script when you are trying to redirect. So, your full code should be like this: if ( is_user_logged_in() && is_home() ) { wp_redirect(‘http://example.com/’) ; exit(); } You should also hook into the right action … Read more

Categories PHP Tags login, php, redirect

stop login if user_status equal zero

The user_status field isn’t used by core, so you could use it for your own purposes. Although there may be side effects if WP ever decides to reuse it in the future. The authenticate filter fires before the user is authenticated. You can hook into that filter and return a WP_Error object to prevent the … Read more

Categories users Tags login, post-status, user-meta, users

How do I set the homepage to the WordPress Admin Dashboard login?

Add the following to your .htaccess file: # Custom default index page DirectoryIndex ./wp-login.php That should work.

Categories wp-admin Tags admin, dashboard, homepage, login, wp-admin

Cannot access wp-admin after disabling all plugin

Well I agree with @Faye. It might be due to the activated theme which is depending on one of the plugin you deactivated. But rather than doing all of the steps you can simply rename the active theme in the wp-content/themes folder via FTP or cPanel. This will deactivate the theme and if it’s the … Read more

Categories plugins Tags admin, login, multisite, plugins, wp-admin

A way to count logged in users and display count?

You can get the logged in users using wp_get_current_user(); . http://codex.wordpress.org/Function_Reference/wp_get_current_user But your probably better off just using a plugin or looking at the the following plugins code. http://wordpress.org/extend/plugins/wp-useronline/

Categories users Tags login, users

How to determine if a user has not changed default generated password

The following will tell you if the user has updated the password generated by WP on registration for a user with ID $user_id: if ( ! get_user_option(‘default_password_nag’, $user_id) ) { //then the user has changed the default password } else { //the default password has not been changed } If you want to send an … Read more

Categories login Tags login, password

How do I Create Forums with bbpress Plugin that can only be Viewed by Logged in Users

The solution I went with was to create a file in my theme’s folder named bbpress.php. I then copied the contents of my theme’s page.php file into the new file and modified it to only show it’s contents when a user is logged in. In my case it looked like the following: if( is_user_logged_in() ) … Read more

Categories login Tags bbpress, login

Change Favicon on Login Screen?

There is an action for that: add_action( ‘login_head’, ‘wpse_41844_favicon’ ); function wpse_41844_favicon() { ?> <link rel=”shortcut icon” href=”https://wordpress.stackexchange.com/favicon.ico”> <?php }

Categories login Tags favicon, login

How to modify the Register link in the login page?

Let’s follow the white rabbit. http://core.trac.wordpress.org/browser/tags/3.3.1/wp-login.php#L414 …can’t be changed, it’s hardcoded. However it leads to here when clicked: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-login.php#L481 …which has a wp_signup_location filter for multisite, which in case your site !is_multisite() will never fire off. If you’re multisite – stop here. add_filter( ‘wp_signup_location’, ‘wpse_46848_hijack_the_back’ ); function wpse_46848_hijack_the_back( $location ) { return ‘my-registration-page-is-better.php’; } Not … Read more

Categories redirect Tags links, login, redirect, user-registration

How does WordPress handle sessions?

Yes, WordPress uses cookie to keep track of who is logged in in cookies. But you don’t have to rely on it. If you want to check if user is logged in, you can just use is_user_logged_in function and you can identify a user by his/her ID which you can get by calling get_current_user_id function.

Categories login Tags login, session, transient
Older posts
Newer posts
← Previous Page1 … Page126 Page127 Page128 … 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