$args = array( 'author' => 1, 'numberposts' => 1 );
The author parameter isn’t documented on the get_posts()
codex page, but it does work.
Related Posts:
- How to know if get_posts() failed?
- How to display posts by current user/author in a custom page template?
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Show the title of the latest post by author
- How can I show many posts an author has per week?
- Why posts array is empty?
- How to give classname to post if post has no content?
- Related Posts function not working
- Get x recent posts by author?
- Get latest author posts inside the loop
- How to show multiple posts thumbnail, title and date in widget
- how to show comments only author which send own posts in wordpress
- Fill the exclude array() in get_posts()
- Retrieve latest post by multiple categories with ID
- posts_per_page – Repeats only first posts ‘post__in’ array
- How to Get Posts, Including Private Ones?
- Get all comments of author’s posts
- How to display all posts divided/ordered by post date? [closed]
- (solved) getting post author’s user role
- Why Query is returning empty array?
- How do I extract just the post ID of the first item in whatever WP_Query returns?
- Show post content and title in diferent divs using WP_Query using a loop
- Change all author links in Blog roll
- Why are my paginated posts always returning the same results?
- Random posts from a pool of posts
- Ignore latest two posts
- Is it possible to use WP_Query to only pull posts with attachments?
- Conditional Tag for has post [closed]
- Display author’s name and avatar in post’s sidebar
- Show posts by author of membership level (Paid Membership Pro)
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- meta_value timestamp older than now
- Every second post different class in blog view
- Loop doesn’t exclude the specified category in home page
- Get posts with multiple categories
- Do not show children of a category
- Display posts of specific category term
- How to get post content from an array of ids?
- Print out last 3 blogposts
- why the same code got different results when using query_posts in functions.php and index.php
- static landing page leading to author specific pages w/ “live” content
- Query posts by Author and/or by Tag
- Display Posts with template on a Page
- Number of displayed posts
- Query for first 3 posts to change the look and feel
- If contributor has published 2 or more posts then show otherwise hide
- How to get posts published on the latest date?
- Can’t understand why sometimes a [caption] field appears
- All Posts Linking to Author Posts directly
- Page and post loop same template
- How to create a “latest news” page showing a list of posts from blog category
- Getting blog pagination to work on page set as front page
- How to group only VISIBLE posts? [closed]
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- search blog posts by author first name and or last name
- Change post author without using wp_update_post()
- Show metabox value last post excerpt, title and link
- Post Filtering by GET URL parameters
- Is it possible to lock all new and existing WordPress posts to one specific author?
- On what hook can I get the queried object’s final state?
- unique post in “$args” of wp_query display more than one post
- Display current post position in Elementor Posts widget
- Why in my query is display two title?
- Migrate posts from category and sub-category via SQL
- How to get the ability to change the author of a post
- How do I insert a after every 5 posts in a WordPress Loop that infinitely loads posts?
- wp_query with ajax
- Echo Text If User Is Logged in But NOT the Author of post
- Custom wp-query in wordpress rest api
- Only allow posts with a specific term to only be viewed by other authors with the same term in their post
- WP_Query: Show 10 posts in date order, first three random
- How can I insert a new markup element after 4 posts automatically? [closed]
- Exclude some posts from displaying in wp_query based on some condition
- posts_per_page returning only one post
- Custom Articles page only showing a limited number of posts per page
- If no posts exist for current day and month, show the next available day of posts
- WordPress Loop: How to display recent posts in multiple divs
- Random posts that always include a particular post?
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- How to retrieve certain number of images from a wordpress post?
- WordPress post filter menu
- How to limit author related post listing ?
- Restrict displaying posts to the poster itself (in Back-end)
- How to get post with slug and exclude categories
- How to display post list in a table layout (multiple queries in single loop)
- Conflict array_splice on loop and query in widget
- Get total post from an author
- Not all posts showing in query
- how to handle the loop using filling bootstrap grid structure?
- Send email to author of post on post submission
- Get all custom posts with a certain taxonomy
- WP_Query custom field pass the post id
- How to convert query sql to shortcode in wordpress?
- Link to date_query results in WordPress
- get_posts not pulling the correct number of posts
- wp_query if have posts show date but not in loop
- How can I set a maximum allowed post size and number of posts submitted?
- Use posts_where to exclude posts ids from wp_query