All Questions
49
questions
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 ...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
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) $...
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-...
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 ...
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 ...
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 ...
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 ...
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.
...
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