Basic debugging…
$current_author = get_query_var('author');
var_dump($current_author);
… would reveal that $current_author
is a string
, not an object. The problem is that you are trying to use the string
as an object
in the query.
get_posts( 'author=".$current_author->id."&posts_per_page=1&order=DESC&orderby=post_date' );
Change $current_author->id
to $current_author
and the query works.
$author_posts = get_posts( 'author=".$current_author."&posts_per_page=1&order=DESC&orderby=post_date' );
Related Posts:
- Display all authors in a theme template
- List of all authors avatars
- Show author archive pages for authors with no posts
- Authors Page : A page of authors
- List authors of site with link and gravatar
- Creating distinct pages for author profiles and lists of posts by author
- Custom Author Fields + Existing Taxonomy – Integrating the Two Dynamically?
- Custom Author Loop
- Showing author’s page with no posts
- Show woocommerce products in author archive
- How to add child page to author.php
- Remove admin role from the “Author” user listing on individual post screen
- Display Authors in a grid loop
- Post list based on the page author
- What does the class look like that is returned from WP_User_Query?
- Is author.php a core file?
- Most recent post is missing from Author page
- Author’s Id from wp list authors function
- Can I Include author login in post class?
- Get 404 when try open author page
- Author Page Create Link to Page That Lists All Author’s Posts?
- Unpublish Authors With not Fulfilled Fields
- How to show list authors with at least five posts published
- How to have certain WordPress settings set by default on a per author basis
- Get top authors for the last 30 days with posts count and avatar
- can’t see information on author page that don’t have posts
- How to fix a specific page (author archive) loading speed?
- How to create many author’s page?
- Author page link in comments is different than in posts?
- if else for custom $curauth-> field
- Exclude Author by ID
- Uncode theme, create author page and author link under the blog
- author.php get current id of author for advance custom field
- the_author function is displaying wrong name and url
- How to add avatar to authors list?
- How to check if a user (not current user) is logged in?
- Woocommerce: assign an “author” to a product
- Programatically change post author
- Restrict one post per author
- Author page: Comments and Ratings?
- Display all comments or recent comments per user on author page
- Add rewrite endpoint to author page + pagination
- Display all authors and their only one latest post
- wp_list_authors including custom post types
- Author profile visitors in last 7 days in front end without plugins
- How To Remove The Author(s) From Certain Posts
- Remove /author/ from the author profile url
- Google Authorship on a multi-author blog?
- Change author base slug to user role
- Display Author role in archive or author page
- How to Add Author Editing Capability to Existing Post by Admin
- Hide Author.php template from specific user role
- Author list ‘special’ author first then ‘normal’ author
- hide something in single page if current author has only one post
- get_the_author_meta( $field, 0 ) returns the administrator $field
- How to link to the current User/Author Profile page?
- Author website URL
- How can I get the author description’s excerpt?
- How to use Buddypress xProfile field as WordPress Bio
- Make user as Default contributor for all Blog Posts
- How to list the authors of all revisions?
- Link Author’s Website in Author Bio
- How to set post author to custom post field via front-end form?
- Show Author information on post page on dashboard
- Display emails of users who already posted at least once
- Get author’s first name
- Display only author posts in dashboard all posts panel
- Get avatar of the logged-in user in WordPress
- Breadcrumbs – get the author?
- Display author name, outside the loop, if they haven’t published a custom post
- Allow Google crawler to crawl specific Author pages
- Add Date and Author to Posts
- How to restrict an author scheduling their post date to a maximum X days ahead from the current date
- Different posttypes for different authors
- Create an Author Page on Registration
- Author template help. How to check if field exists in the profile?
- Disable WordPress Comment Author Name
- Condition within single.php to send an email to the post author
- Display Recent Posts in BuddyPress Profile
- Display All Authors only
- Display Authors avatars when more than one author
- How to reorder the content of the single post?
- Possible to switch between admin view and author view?
- How to show author page link
- get_comment_author_link not working properly
- Show Published and Draft posts from Logged in Author
- WHen I click on post author (on frontend) it doesn’t go to author page
- Author social media aren’t shown on the page
- Show text only to the author of the article
- Display Random Post in Author Page
- Show author image at home page latestest posts plugin
- Open the_author_link() in a new window
- WordPress author box
- Show author name not the author ID
- Calling a custom profile field only it it exists
- Change Post and CPT author on the fly while publish the post
- Profile Field In Admin Bar
- How to force the Author Dropdown to display in Quick/Bulk edit?
- Create guest author page via php
- How to customize the author page in wordpress?