You can use get_the_author_meta() which returns the requested data of the author of the current post. If you’re on the author archive page (e.g. author.php) that will be the ID of the user whose profile you are on.
get_the_author_meta( 'ID' );
Related Posts:
- Display if author page is author page of current user
- Query posts by post type, author and post meta
- Getting all user metadata from user
- author.php with ACF and CPTs
- Query to return maximum of one post per author
- How to add custom query filters in WP_User_Query
- Show only oldest post by author
- Function to check if author has posted within the last x days
- Show one post per author and limit query to 8 posts
- Filter user list that meta_value is empty
- Query wp_usermeta alongside wp_users
- Pagination 404 errors for author posts query on author.php
- SQL User Query by Multiple Roles using PHP
- Only display authors who have posts
- WP-Admin edit.php & post.php slowdown after import of 10k users
- Get List of all the Authors
- WP User Query get all authors with last name starting with specific letter
- Sort users by “birthday” using WP_User_Query
- Hide Administrators From User List except current user (administrator)
- How can I display list of all posts from a specific author, with publish dates in the future, on an author archive page (author.php)?
- Get authors by term id or slug
- How to display user order by role
- Import wp users via one click demo option
- Custom Query by Author field and meta
- slow WP_Query for non-admin user
- WP_Query (list) posts according to author’s custom field
- Exclude some authors from query
- Get author if post has multiple authors
- All posts returned when author of 0 is queried
- Prevent author bio page from showing in search results
- Get multiple users with meta value in one query and populate WP_User class
- Posts in loop all show the same author when there are many authors
- Reduce number of SQL queries inside WP_Query loop to fetch author data
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- Get user first name from custom endpoint
- Exclude authors IDs from WP_Query
- WP_Query author parameter not working
- Storing an array of objects related to each user
- Create one-use post dynamically, add to main query, do not insert post (user profile view)
- query post by author gender
- How can i show pagenavi in my author.php?
- Query to get last posts from authors of blog
- Query pages created by deleted users
- wp query to use both author id and meta_query
- Counting instances of words in the results of a post query
- Random users always showing same 8 users
- Get authors list and sort them by recent posts
- Set “editor” role to existing user
- How to query 5 users in random who have published more than 10 posts
- How to query users by post count no less than 10
- Merge wp-query and get_users
- Get all wp_users sort by metakey
- query all posts published by certain user id
- Logging search queries for logged-in users
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- Show subscriber id in loop
- WP Query get posts by specific author IDs if one of several logged in authors
- Query Users by post count, last 30 days and display each users post count according to post type
- Get users query makes the site loading time too big?
- Get all user with both meta_value
- Group users by meta field, with name of meta field as group title
- How do I get posts that have a thumbnail in WP_Query?
- Multiple WP_Query loops with Pagination
- IP address character limit
- How to order category.php loop by ‘meta_value’?
- Searching user meta using WP_User_Query
- Which custom query am I in and how can I access its properties & methods?
- Does using a custom query_var create a security hole?
- Date query not inclusive despite parameter being true
- How to display the number of articles published per user
- Change default ordering of taxonomy terms – pre_get_terms
- Ordering Posts Type A by Custom Fields of related Post Type B
- current_post not working – give me -1 for every post
- Order posts by taxonomy count
- WP_QUERY to display woocommerce products whose author IS the logged in user
- When variable value have space between word, doesnt show any result WP_Query
- Transient not behaving as expected
- the_post() within switch_to_blog() altering my excerpt
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- WP_Query returns posts_per_page + 1 every time
- WP_Query – Accessing MetaValue from Query Result
- problems with comments_number()
- Does WordPress have something like Drupal’s DB API?
- PHP – Loop custom post type categories within jQuery Tabs
- Get a list of ACF Repeater-Fields as array
- Show single posts date, in a page of posts
- Compare “Main” post ID to ID inside wp_query loop
- Attempt to display site authors in a carousel – User Image not Outputting inside li tags
- problem with the loop
- Facing problem with tax_query results
- sanitize_post() is not sanitizing Post Object
- Unusual high query of user meta data
- Woocommerce featured products query no longer working
- How do I get all authors posts of a custom post type outside loop
- Custom WP_query and integrating into theme file
- Why does order ASC break offset in WP_Query?
- new WP_query using custom fields
- Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
- Change ‘post_modify’ with a query
- shortcode with $atts with strange results