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
- Get All Pages as strings in array
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Attach link to pages accoding to tags
- Different role for free and pro users in wordpress without using bbpress
- display different pages content on single page
- Defined user role to access plugin’s pages
- How do I get my page “About” to show up on my WordPress site?
- Search Page: activate html code if the tag is on the page
- Display custom_post_type with current taxonmy of a page
- Control what custom posts a user can see
- Post id(login page) not found
- Display inner pages like posts.[Like how post excerpt works]
- include exception inside theme for empty widget area
- How to end the Page Load Event and load after that?
- Managing many pages on a WordPress website
- Featured Image not displaying in a page
- How to show the view more on my display of pages shortcode
- How can I add a new page in the pages tab that belongs to specific theme?
- My pages disappeared from the list
- New page has incorrect URL
- Custom Upload Adds Ghost File
- How to get sort content by page id?
- Subscriber role – blank page
- Display child pages on homepage template
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Pre-populating new Page creation with shortcodes
- Allow users to change author of post
- Have subdirectory name act as $_GET or $_POST data
- Set order acs and no paging for archive page
- Create page excerpts for landinpage
- Setting Default Screen Options
- Pageview all of sudden not working
- Childpage title + content on Parent Page
- Why my site scroll top when end load pages
- Issue with page not erasing
- WordPress Pages “allow comments” meta option can’t be checked
- Category Page Custom Layout [closed]
- My page won’t publish
- How to copy specific page content and create child page?
- Displaying Content Only in Certain Page IDs Not Working
- Content template when adding a new page
- How to output different content of page on different places in my template
- WordPress slow pages/post, hangs and white text
- WordPress white screen with “All Pages”
- How to create child/sub user under parent user
- Pages redirecting to homepage
- custom page or standalone page?
- How create a multisite setup with “phantom” accounts and passwords?
- Prevent page from displaying