Solution, using and statement ‘&&’ for another specific role.
Closing <?php if() : ?>
, <?php else : ?>
Tag with a Column : to be able to post scripts inside the Loop.
<?php
global $current_user; // Use global
get_currentuserinfo(); // Make sure global is set, if not set it.
if ( ! user_can( $current_user, "administrator") && ! user_can( $current_user, "specific_role" ) ) : ?> // Check user object has not got subscriber role
<!-- Not Administrator -->
<?php else : ?>
<!-- Administrator -->
<?php endif; ?>
Related Posts:
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- How can I call a specific file (via php) by referencing the logged-in username?
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Add another role to a user when they click a button?
- How to connect database table to each registered wordpress user.
- Get author meta of all writers
- Forbid certain users to access a specific page
- How to lock users account until approvation
- How to create a User Role and give permission to only use Web Stories plugin?
- How to create custom user role without plugin?
- Custom Admin Menu Report for Specific User ID
- How to add custom user role into wordpress
- Remove update nags for non-admins [duplicate]
- Allow Editors to edit pending posts but not draft ones
- Create a global variable for use in all templates
- Add extra field to users
- How to target with css, admin elements according to user role level?
- Integrating WordPress to my website, while keeping my own authentication system
- Editor role cannot save custom theme options
- How to auto login user again after change user_login
- What is the most efficient way to search users by their display name?
- Showing user ID on user main page from screen options
- Getting the Current User
- Authenticating to WordPress, using my own authentication two-factor system
- How to track a users progress through pages by inserting data into WordPress Database?
- How can I default to all WordPress roles when parameter is not included in shortcode?
- there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?
- Delete option value from array using update_option()
- Display user role Name – not slug
- Add user settings to specific roles
- How to get a list of all possible values of a specific user meta key?
- User’s total comment count excluding comments on their own posts
- User management system similar to wordpress one?
- Hiding div based on user role
- Add New User, extra fields which are required?
- user_profile_update_errors hook not executing
- Modify user profile data through scripting?
- wordpress archive a user
- Best practice for show data to one specific user?
- Call to undefined function get_userdata() in plugin
- Change CSS based on is_user_logged_in
- How to show a users bio on a page
- “operation successful” message
- Add post with approval by the admin
- php if username is role
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- Show current user posts only
- Shortcode for Listing Users from Meta Value?
- create front-end users post list by specific category
- Show site content based on user role
- Query for user roles
- php return username of currently viewed author profile
- How to list users like an archive page 10 users on page and have navigations
- Redirect to current user page upon link click
- Use of antispambot with $curauth->email
- Plugin: Front-end Editor – User role specific editable content?
- Edit and delete permissions pages and posts
- Generate a QR code when creating a new WordPress user
- Execute function only for specific user roles
- Change wordpress’ database data using ajax – how to get current user id?
- Sort column in Users admin Tab
- Woocommerce display orders with products from specific categories to specific admins
- Storing huge number of users in wordpress
- Admin Panel 404 Error after login
- How to block specific user id in custom login form?
- Get current user id in function php
- how to create a user rule that can only manage support tickets?
- how can I call a function when time expire
- Call WP Rest-Api to GET /users/me returned NOTHING in console
- Uploading/integrating custom user registration page
- Edit a function to take different actions based on user role
- If user has clicked link add class and store using PHP/WordPress
- Store data from JavaScript object to custom table in user account
- Page template not working when logged out
- Used a code to revoke some dashboard menus for my contributors but for some reason it’s revoked me access to the editor [closed]
- How to change the value of a variable using input field?
- Display current user metadata on WordPress page
- How do I track which user clicked my button?
- How to give custom roles the capability to edit one Menu instead of every Menu
- Query to show average # of months all accounts with specific role have been active
- How to properly create multiple conditions to redirect users roles to different pages
- wordpress more than one ajax request at the same time issue
- Editable Student file associated with basic User ID
- Adding users to another blog
- Changing WordPress author name in database
- Role exception for a settings sub menu
- Private messaging – Getting and displaying the avatar/url of a message recipient
- Updating custom user meta
- Loop 1 user randomly
- Allow BBPress participant role to trash topics
- How to ‘remember’ a site member’s last visited page?
- Let users register weight each day and save it in DB
- Display a list of users with avatar filterable with alphabets
- Switch-Case and user_role
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Check if username doesn’t exists
- WP query with variables gives no result for specific user
- Import users and custom user meta from csv
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- Getting invalid user ID error when creating a new user with wp_insert_user