You can use the get_the_author_meta()
function for this purpose. Use the get_the_author_meta('ID')
for only get the ID.
Ensure you check the page first with is_author()
function before getting the ID.
https://developer.wordpress.org/reference/functions/get_the_author_meta/
https://developer.wordpress.org/reference/functions/is_author/
Related Posts:
- Make display name unique
- How to create a public profile for authors/contributors/users?
- Force users to complete their profile after they register? How to
- Upload gravatar in WP profile?
- add ‘file upload’ field to user details
- Completely hide user info
- Drop down list in user profile page
- Custom style on profile options page
- Add custom fields to the user profile
- Cannot set user passwords
- Is there any function available to echo current user’s profile url?
- How to add local users to wordpress without email password?
- Disable user profile editing for one user
- how to make a profile entry read only except for site managers [closed]
- Forcing WordPress to work differently
- Remove user profile field [duplicate]
- How to add a user profile page to frontend?
- Is there a way to make custom fields only editable by administrators?
- Editable registration date field in user profile
- Profile page for user roles
- User profile updates password even if not filled (Theme my login) in Firefox? [closed]
- How to Create a User Profile Page?
- Prevent subscribers to changing certain profile fields
- Creating User Profiles using author.php
- Create a “user log”
- How to display text if profile fields are not filled?
- What is correct way to change user’s email?
- How to hide user profile fields based on the role of the viewed user?
- How to make current user’s avatar + display name link to their profile?
- Give users alternative/second avatar that is rectangle sized
- User can manage one page accessible by everyone?
- redirect user to their profile after log in
- How to display all user profile info in myaccount page wordpress
- How to add extra field in profile page and show in myaccount?
- WordPress 5.8 – Hide or Remove personal fields from admin Profile page
- How do I update user email from frontend input field?
- How to display extra fields for user
- I need a link that directs the user that is logged to his profile
- How can i display pagination in custom comment list?
- How can i add user display name drop down menu in frontend?
- How to create page for user?
- How to make custom user profile page public?
- update custom field user profile from front end form
- Require confirmation of current user’s email before updating database and before send_email_change_email
- Showing extra profile fields in admin – problem with underscore
- Restrict Access to the User Profile
- Add an ‘edit profile’ page with Genesis
- Manage user profiles with WordPress
- Separate Profiles for Users
- Fetching posts that match a User Profile setting
- How to create a link to a user’s profile page
- Validate user meta and redirect
- Designing a member area on my site
- Storing additional information about the user
- Modify Profile Biographical Info Field
- How to create front-end (editable) WordPress user profile pages?
- Disable editing profile for second time
- What techniques can a user employ to achieve a password rated “strong” in the WordPress password checker
- Cant edit profile from frontend
- how to use joomla password format in wordpress?
- How to do get_users() with multiple meta_keys
- Limiting the number of users
- Track logged in users’ visits
- Plugin that would allow WordPress Authors to “follow” other Authors and query “Activity Info” from that
- Add User meta fields, which only admin can edit
- Limit content by user registration date
- What is the best way to avoid spammers registering to my blog?
- Prevent Admin user to edit/see super admin from users list
- How can I default to all WordPress roles when parameter is not included in shortcode?
- Redirect User to Homepage if no other redirect is specified
- show text If special user is logged
- Can user login details be used for other applications?
- Does an AJAX call on the Admin Side Automatically include the User Data/Capabilities?
- WP not logging in at first time
- Log out users from every where
- No user found when using REST API
- is_user_logged_in() throwing undefined function error
- How to prevent a specific users’s profile photo (gravatar) from showing on the frontend to other users?
- SQL Bulk update all WordPress user’s nicknames to firstname + lastname format
- Redirect logged on user to a specific page based on wp user role, page id
- Automatic Website user password generation
- Need to manually add multiple WP users with same e-mail address (with good reason)
- WordPress Redirect Specific User. Tired of Peter’s redirect Plugin its not working
- Extending the user profile [closed]
- How to allow access based on the user meta flag
- Authentication between two different sites using the WordPress login cookie
- How can I display Only the first Array/Object?
- Return all users that have one or more published blog posts
- members only products
- Modify the user data stdObject and add extra items to it?
- Change “logged in as a ” link in comments form
- Show a list of user posts in the user admin page
- Specific Content on pages based on user
- force registered user as seller
- Not able to call value in the core files
- Privacy in WordPress
- How to display Most Recently Read 10 Posts by a logged in user in wordpress
- current_user_can() returning true for capability when the user and role do not have the capability
- Some data of one custom user profile is erased when I update another custom user profile
- WordPress password as plain text in email