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 set?
Related Posts:
- wp_enqueue_script was called incorrectly
- Masking logout URL
- How can I tell if I’m on a login page? [duplicate]
- Is it possible to use a forgot password url filter?
- redirect wp-login.php to another page
- Login using the password from protected pages
- How do I redirect upon login a specific user based on role?
- Logging in redirects to correct page but shows logged out content until forced refresh
- Remove default user registration, login and subscriber profiles
- is_user_logged_in not working to redirect only logged out users
- Members only site – still need the lost password page accessible
- How to change login labels
- How can I get my Script to work on the Login page?
- Login Redirect if Logged in from Specific Page
- Unable to login using username
- When a user logs in, how can they view the website instead of the admin menu?
- WordPress PHP Conflicting User Sessions
- Get User Login Data (date, time… )
- Registration Hooks don’t appear to be working
- If user is logged-in display/hide something
- Secondary Menu and Logged In Users
- Prevent WordPress Automatic Logout
- error at login page in wordpress
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- Logout Redirect and also WP-login.php Redirect
- loginout function customization
- Add Login and logout buttons to top menu bar
- Show errormessages on wrong username/password on custom loginform?
- WordPress login set cookie that survive browser exit (wp_signon function)
- This code is supposed to only allow user to be authenticated if accountVerified is equal to 1, but it still allows user to be authenticated otherwise
- Prevent wp_signon redirect on failed login for ajax login
- How to redirect Subscribers on login to specific page, when logging in from a Page
- How to replace ACTION url from original wordpress login form?
- Unable to login after registration
- Allow logged in user to view a Page, else send to login screen and then redirect back to Page
- Redirect after login to current URL
- Login functions
- WordPress permanently logging users out
- How to request login for user but not for bots
- update_user_option not working as expected
- “Headers already sent” while trying to add a CSS file to my login page?
- How to check if a user exists by a given id
- TinyMCE custom styles remove class when switching styles
- Add admin bar link to edit author
- How to include one class/instance without using global variables
- Modify search function in WordPress (TwentyTwelve)
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- syntax for remove_filter in parent theme with class
- Remove Header and Footer in iframe
- How to Acheive the custom woocommerce category template
- Can I remove the Rich Text box editor for a specific post?
- How to add CSS style sheet dynamically in wordpress
- How to update BuddyPress xprofile fields programmatically? [closed]
- Redirect if not logged in?
- A snippet after every image
- Programmatically set page template based on page ID
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- wp_remote_post with ssl:// protocol
- Best way to programatically add “rel” attributes to page and post images
- Remove function or filter
- How to include local menu based on page id?
- Default Gallery Edit/Template Editable?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘greenday_head’ not found or invalid function name
- Override a theme function in a child theme?
- changing behaviour of get_search_form
- Include default functions and methods
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- Functions.php – Cannot Modify Header Information SOLVED [closed]
- shortcode help require
- echo custom fields with AJAX
- Function filter breaking tag archive menus
- How to create a functions.php in child theme? [closed]
- wordpress get_post_meta give only first value
- How to echo the value of an array element using a function via a shortcode
- Determine if, within a post, you are on page 2 or greater – WordPress documentation circular
- I can’t add CSS with functions.php
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- Protect get_query_var from manual input in url
- widgets not working
- Shortcode to get featured image of specific id post
- wp_get_archives() output
- hook for dashboard show_user_profile
- Get slug of current category in functions.php
- removing description tabs – single product page – breaks footer
- Post content overflows on my mobile phone
- OOP Switch statement with array as parameter
- Woocommerce custom calculation function
- button to toggle css styling / div visibility?
- is_user_logged_in() not working in homepage
- Pagination won’t work on custom page
- Does WordPress function replace_hello() exists?
- Shortcode Function – Can’t get anything else to return after running shortcode within shortcode
- Trying to Add a LEFT Sidebar?
- Getting error while trying to use custom comment function
- Load WP Admin scripts in a child theme functions file
- add_role menu pages are not visible
- Highlight only current on single pages
- Changed functions.php file and now site is blank [closed]
- PHP error in shortcode [closed]
- How do i set global variable in a function in wordpress functions.php