You can use get_queried_object
to get data in the current author page:
<?php
$author = get_queried_object();
// uncomment next line to see all author data
// print_r( $author );
if( in_array( 'author', $author->roles ) ) :
echo "author";
elseif( in_array( 'subscriber', $author->roles ) ) :
echo "subscriber";
endif;
Related Posts:
- remove/hide pages from users backend
- List all private pages user has access rights to read
- Role can edit just one page [closed]
- One author not showing in Author drop down list while editing page
- Allowing user to edit only certain pages
- Check IF is a “single product page” and Check the “role” for a Redirect
- How to let contributors to create a new revision(draft) editing their published posts
- Restrict admin access to certain pages for certain users
- How to count current user’s pages?
- How to display page title+link of page created by user
- Associate Page with User
- Users roles, make a page belonging to multiple users
- User capability of create page/new page
- the_author_meta(‘user_url’, $author->ID) not working properly. how can I solve this?
- How do I create a separate page for each author?
- Personal page for every user (not just authors)
- Adding New Users to Your WordPress Site for edditign only one page
- How to create a page that lists all the experts(Users with same access permission as author)?
- Restricting Pages based on Hierarchy and User Role
- New user Registration data imported into Page
- Change base URL of pages created by certain users
- This code won’t find authors page?
- Noindex subscriber author page
- Return subpages of an author if the parent page was published by an other author
- Allow a user to edit their own page and profile only
- Custom page only editable by one user
- Authors posts on a author created page
- trying to add a author value in wp page links?
- Author page like wordpress answers
- Create custom page to author.php
- Custom user tables not working after migration
- When I enter password, I’m redirected to the WordPress login form
- Every change made by “Author” role is going to “pending review”
- How to list pages from an author?
- Not allow add New Page for role ‘editor’
- Page view displays not properly after update wordpress
- How to limit the pages shown in the page manager to those created by the logged in user?
- Author information on all pages
- Edit Page Content not showing
- Add role and edit page capabilities
- disable trashability for certain pages
- Filter posts by author selected in page
- Create custom archive page for individual authors which is separate from the author.php page
- Paginate Links not working
- Want to add post to user dashboard
- wordpress user profile page
- Forbid certain users to access a specific page
- Save search criteria per user and show on custom user page
- How do I count the number of pages a user has seen on my site, and force them to log in after a certain amount
- How to customize the author page in wordpress?
- User profile in front-end
- How to configure WordPress to handle 75,000 pages?
- multi page password protection
- Create a “Dummy” parent page for a hierarchy in page listing?
- Execute a function when admin changes the user role
- Password protected post or page – error message by wrong password?
- How to enable the theme editor cap for an editor role?
- Child page from 2 different parent pages
- Redirect after users complete profile form
- Redirect “Sorry, you are not allowed to access this page.” to Home
- select a private page as parent for another private page
- How can I automatically add child pages to pages in a WP menu?
- Job Manager plugin help?
- How get get list of pages in ajax search
- How to disable a specific page for a specific user
- Can I allow certain people to add/edit pages within a parent?
- check first and last child pages wordpress
- Special Character Appearing in my WordPress Pages Content
- Prioritize visible content – Page speed issue on Google insights
- Shared account / dual blogging in WordPress
- How can I check user capability when a page loads (via functions.php)?
- How to get custom post_author?
- Bad pages redirection
- User roles not displaying
- Remove_filter (‘the_content’, ‘wpautop’) only pages
- Preventing role reading others posts
- Personalized Author Area
- Password Protect Pages Not Working
- Can I connect a page to a taxonomy?
- wp_nav_menu: output featured image of each page listing
- Change displayed “page name” to distinguish multiple pages with the same title
- How to transfer a site to hosting?
- hide page menu from admin panel for specific users
- Cannot use old slug – it just 301s to site home page
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- Display inner pages like posts.[Like how post excerpt works]
- include exception inside theme for empty widget area
- Add text to the bottom of particular pages
- Access wordpress pages using a self signed shared ssl
- Page loads all pages of the image gallery with pagination
- Group Pages based on Parent in Admin Area
- Custom Post Type supports author
- How to exclude page in pages module
- get id custom tables on current page
- static page with buton that opens collect email form
- Multiple WordPress Pages
- How to create an user defined page?
- Missing page on wordpress “Pages” dashboard [closed]
- How to create a specific role to manage users