Skip to main content

All Questions

Tagged with
1 vote
0 answers
51 views

Nonce verification problem when logging in after a logout

I'm having a problem with nonce verification. The theme I'm using has an AJAX login form that has nonce as a hidden field. It normally goes to my account page after a logout, and I can re-login from ...
FlyingFish's user avatar
0 votes
1 answer
132 views

Changing login url

I've been following this guide on how to change your login url : https://www.malcare.com/blog/change-wordpress-login-url/ However, upon adding the logout, login and lost password hooks, I've noticed ...
dvm node's user avatar
0 votes
2 answers
2k views

Can i hide a dynamically created div to logged out users?

Is it possible to hide a specific dynamically created div from user that is logged out? I have tried this but doesnt work: <?php if (is_user_logged_in()): ?> var element = document....
Ryan's user avatar
  • 5
0 votes
0 answers
22 views

Inconsistent login state

I'm logged in with "Remember me" checked. I then click the logout link. At this point I appear to be logged out - I can no longer access member-only pages, and menus that only appear for ...
Llaves's user avatar
  • 101
0 votes
1 answer
566 views

add class to element if user is not logged in [closed]

Please help . I need to add class to this button if user is not logged in <?php echo apply_filters( 'my_order_html', '<button type="submit" class="ADD-CLASS-HERE cfw-primary-btn ...
Teymur Abbasov's user avatar
0 votes
1 answer
270 views

Check if user had autologin & if so, logout

I'm trying to create a function which autologins users, but upon visiting certain pages also performs an autologout if the initial login was obtained via autologin. I've written the following code but ...
BarrieO's user avatar
  • 89
1 vote
1 answer
177 views

Logout users upon login, based on caps/role?

To reduce spam registrations, users are assigned the pending role until they're vetted (at which point they're assigned the subscriber role). The pending role has no capabilities. When pending users ...
arielsfr's user avatar
0 votes
2 answers
46 views

Lock out all WordPress Administrators except two specific users

I used the snippet below to lock out all administrators and editors except myself if ( is_user_logged_in() ){ $current_user = wp_get_current_user() ; if ( in_array( 'administrator', (array) $...
Nigel Rodgers's user avatar
0 votes
2 answers
4k views

Log out without confirmation request (nonce)

I have a Wordpress site with WooCommerce. I would like to add a Logout option to the Menu that logs out the user without asking for confirmation. So I included a menu custom link with as URL: /my-...
Nick's user avatar
  • 127
0 votes
0 answers
82 views

Problem with is_user_logged_in() function in some pages

I faced a problem with this function is_user_logged_in() in the header to test if the user is logged in to some code. Its working just in some pages like homepage but the other sub-pages not I don't ...
Loader1's user avatar
0 votes
0 answers
32 views

How to add Loginout to Sub-menu

I've been searching all over the interwebs for this one. I've got the code snippets to add Loginout to a menu as a main menu item. I'm now looking to understand how to attach it to a sub-menu. This is ...
CharlieJustUs's user avatar
0 votes
0 answers
132 views

How to make Logout Link consistently appear on all web pages?

I am using the following code to add Log In and Log Out links in the Primary Menu. Can't give a web link because the site is still under construction. //* Add a Login/Logout toggle item in WordPress ...
chris's user avatar
  • 1
0 votes
1 answer
2k views

Change Login or Logout text based on status

I'm trying to display text in a button in the header that says "LOG IN" or "LOG OUT" depending on the visitor's status. The button calls a slider action, so I just need to change the text displayed on ...
hedgehogsweater's user avatar
1 vote
1 answer
360 views

Session Experies and Get Logged Out Within Few Minutes

I have wordpress simple blog with few plugins installed. My problem is that after logging and working for few minutes (hardly 2-5 minutes), session expires and I get logged out of the admin area. ...
sanjay ojha's user avatar
0 votes
1 answer
1k views

How to Show Different Menus to Logged in Users in WordPress [duplicate]

how to write code for this requirement and i want to show menus only in header menu with different menus to logged users
Vangari Madhu's user avatar

15 30 50 per page