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

is_user_logged_in() isn’t working

There’s nothing wrong with the function, it’s the fact that you aren’t actually being logged in! You say you’re making your own login form? Does this post to the standard wp-login.php, or do you handle the request yourself? Does the path/domain of the form differ from WordPress? If you inspect your cookies, are any being … Read more

Categories functions Tags functions, login

Get user logged in status from within a plugin. $current_user not defined

One question: is the 3rd party that’s sending the request passing a user cookie? If not, then WP will treat the request like any other guest! If it is, have you inspected $_COOKIE when send_response() runs? Update: Thought I’d try and wrap up the discussion below, once and for all 🙂 You’ll have to maintain … Read more

Categories plugin-development Tags hooks, login, plugin-development

Advice on setting up private site

I think the best way is just to create accounts for every people from spreadsheet. You can use code provided here but generating random passwords instead and sending a mail to each registered user with their information and alerting them to change their passwords on first login.

Categories plugins Tags authentication, login, membership, plugins, private

WordPress Login Box horizontal at the top.

Use wp_login_form() and set the p elements per CSS inline, so they can sit side by side: #loginform p { display: inline; }

Categories login Tags login

wp_logout logging everyone out instead of just the user that clicked the logout link!

Seems as though the session needed to be destroyed with the following: <a href=”https://wordpress.stackexchange.com/questions/66309/<?php $redirect = bloginfo(“url’); wp_logout( $redirect, $echo ); ?>”> Logout </a>

Categories login Tags front-end, login, logout

Front-end login problem: requires re-authorization when accessing dashboard

OK, I’ve got it! According to wp codex, second parameter of wp_signon() function refers to whether to use auth cookie or not. So if you use wp_signon( $user_arr, false ); …re-auth will not be required.

Categories login Tags front-end, login

login_redirect for Mobile Web

Adding a conditional check such as,   $current = “http://”.$_SERVER[“SERVER_NAME”].$_SERVER[“REQUEST_URI”]; $mobile = “http://www.example.com/mobile”; if($current == $mobile) { //redirect to desired location } I’d provide more detail but am currently on mobile, so it’s difficult to write. See how you fair with the above.

Categories redirect Tags login, redirect

Registration and Login form

Go with Theme My Login. Well written and very functional

Categories login Tags login, user-registration

Redirect based on log-in status per JavaScript

To test if a user is logged in use is_user_logged_in(). To redirect a visitor use wp_redirect($location, $status = 302). You can combine both: <?php $location = ‘http://localhost’; if ( is_user_logged_in() ) $location = admin_url( “https://wordpress.stackexchange.com/” ); wp_redirect( $location ); In JavaScript (sort of): add_action( ‘wp_footer’, ‘wpse_73701_button’ ); function wpse_73701_button() { $location = is_user_logged_in() ? admin_url( … Read more

Categories users Tags javascript, login, redirect, users

Showing A Menu When Only Users Are Logged In [duplicate]

Use the is_user_logged_in() conditional to output a different menu depending on user login state. For example: $theme_location = ( is_user_logged_in() ? ‘header_logged_in’ : ‘header_not_logged_in’ ); wp_nav_menu( array( ‘theme_location’ => $theme_location );

Categories login Tags login, wp-login-form
Older posts
Newer posts
← Previous Page1 … Page18 Page19 Page20 … 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