You are using 'author' => ...
twice in your code.
To get the author’s ID, you should use get_the_author_meta('ID')
instead. So, remove the second author argument, and use this in your code:
$author = get_the_author_meta('ID');
$args = array(
'posts_per_page' => $per_page,
'author'=> $author,
'post_type' => 'ultimate-auction',
//'auction-status' => 'expired',
'post_status' => 'publish',
'offset' => $pagination,
'orderby' => 'meta_value',
'meta_key' => 'wdm_listing_ends',
'order' => 'DESC',
);
By the way, the global $post
itself contains the ID of post’s author, which you can get it by using $post->post_author;
.
If you want to use the author’s name, you can use 'author_name' => ...
together with get_the_author_meta('nicename')
.
Take a look at author parameters of WP_Query
in the WordPress codex for more details.
Related Posts:
- Getting a list of custom posts by author
- Display Authors Comments on Profile Page
- the_author_posts_link() for authors of custom post types
- Adding %author% in custom post type URL structure?
- Author archive only for custom post type
- Custom loop for custom post type for current author
- Show Custom Post Type by Author
- Recent comments on author page?
- Get the terms of a custom taxonomy for a specific author in author template
- Prevent author role from editing all posts in custom post type?
- Display only custom post type count for current author on the “At a Glance” dashboard widget
- WP-Admin edit.php & post.php slowdown after import of 10k users
- Check if author or current user has posts published
- Get Author for Single Post in Custom Post Type
- How do I prefix blog post urls as mysite.com/blog/%postname%/ but allow authors to still be located at mysite.com/authors/%nicename%?
- How can I show a custom post type for users in the authors.php file?
- WordPress post count not showing for custom post type author
- How Can I Set the Post Author of a Post I Just Created With PHP?
- Custom Post Type and Labels
- Filter post by current 2 differents users id
- How to only show posts assigned to current user, only in certain post types
- get_attached_media() on author page not working
- Permit users with author role to edit a custom post type
- URL rewrite add author as base
- Edit the author of custom post type
- Can multiple authors be assigned on a single custom post?
- How to restrict author to only access one custom post type ?
- How to show featured image block in custom post type for Author?
- Author posts not appearing for custom post type
- Display an authors post on a single page only when they are logged in
- Select other roles as custom post authors
- post body class for current user only if they are the post author
- Restrict category access to specific users/groups. Author always has access
- Find custom post type url by author
- Display latest posts of author in a custom post type
- Custom post type title of each author in his own post
- get post count for related author
- Display author box on just certain category posts?
- Display custom post counts for author , not default posts
- Use Author Ids or Names to echo different output inside loop
- Creating an option for writing a post without an author attribution for a group blog on WordPress
- Showing only posts from the current user who is logged in?
- “Author” custom post type
- how to display author name in custom post type
- Limit custom post type to the authors only on front-end!
- How do I get all authors posts of a custom post type outside loop
- Why is wp_list_authors not picking up Authors from CPT’s?
- Need to display author’s email id in the “Edit post” field in wp dashboard. How do I do this?
- Delete Post by User
- How to make id user can be view content
- Display posts on parent post if author coincides
- Author archive custom posts only?
- Set a static page as a user profile page?
- I want to link an author to everything from any post type that they publish on the website
- Get author image for posts in loop on custom type posts page
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Custom Post Type Author Array Problem
- Show a custom field instead of username in the backend author area
- Custom Post Type supports author
- Author template – separate custom post type by custom taxonomy term for $curauth
- How is get_the_author connected to a custom post type?
- How to display Author Profile based on Custom field value
- how to show Author post type count
- Emailing Authors only when a CUSTOM POST TYPE post is published- not when edited later [duplicate]
- Loading Custom Post Type Events into jQuery-based FullCalendar?
- Custom Post Type – Same Post Name, Different Post Type
- Custom Search form not working in localhost
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- How to have the right design for a custom post type without accessing themes
- Passing parameters to WordPress static front page
- Dynamic Custom Post Type Plugin
- Pull in custom content types into page template
- Assigning the same custom meta box to multiple post types
- Custom Post Status Transition Issues With Get Post Meta
- Custom post type not displaying all entries
- Listing tags from a custom post type
- How to show first name and last name in custom post type columns
- Review site custom post type structure
- Relationship between set rewrite flag in register_post_type and add_rewrite_rule
- Custom User role not working with custom post type
- Is it safe to change a Custom Post Type from “hierarchical:false” to “hierarchical:true”?
- page not found for single-type.php file
- echo selected value from dropdown
- Default Category Page not showing custom post type which has taxonomy category
- Capabilities not working with custom post type
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- How can I see a list of products that I have set to outofstock through a custom field check box?
- Custom Post Type URL Rewrite’s
- Get dropdown child categories from parent category of custom post type
- Changing default admin column sorting to an ACF Date Picker field
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Getting 404 on child page with pre_get_posts() on custom posts
- Set different posts_per_page for custom post type/taxonomy
- issue with custom post type feed
- Creating adminable dynamic filtering on custom post type
- Use the page picker from wordpress menu creation page
- CPT and metabox: create multi checkbox by using array?
- WordPress show custom post type on homepage
- How to make a template for a specific post of a custom post type?
- Custom slugs with dates & IDs on Custom Post Type