Sebastien’s answer got me on the right track. I should not be using the_author, because I am not looking for the author of a post (My query is not returning a post, but a user), rather the name of the user.
I changed:
echo get_the_author($spost->ID);
to
echo $spost->display_name;
Related Posts:
- Change media attachment author via mysql query
- Order query by post meta value
- List author’s posts with SQL
- Query unique author ids with published post of type job
- Query parsing only author ids
- Query filter on custom post by current author in post widget for elementor query id
- Get all image from single page using this query
- wordpress query – orderby child post date
- Add multiple value to a query variable in WordPress
- wp_dropdown_categories with multiple select
- How to tune search argument in WP_Query to show only exactly the same results?
- How to get my loop to pull posts into three columns
- Custom $wpdb Query for Custom Post Type by Category
- Can’t pass table to $wpdb->prepare
- How to extract all ID variables from a query string?
- Date query year and month OR just year
- Are database queries created using WordPress filters protected from SQL injection?
- wordpress plugin that show my reputation (points) in any stackexchange project in my wordpress blogs
- get post id using the $query_vars variable
- Remove Unnecessary Mysql Query
- How to remove duplicate query on page load or make them cacheable
- Get List of all the Authors
- Is there a conditional tag for latest post or do i need a query?
- wpdb::prepare() isn’t working
- How can I apply a meta query for a single custom post type in the main query?
- get_posts() loop returns the same the_title() for each post
- Custom Author Loop
- How to check current user in meta value array in WP_Query meta_query
- Using pre_get_posts to target a query in the sidebar
- How select a specific query when setting offset?
- Temporarily storing main search result
- Help with MySQL to $WPDB query
- sql select query in wordpress ‘page’ [closed]
- wpdb->term_taxonomy count posts from both published and private posts?
- Query based on title, with ‘compare’ => ‘IN’
- Issue with using add_rewrite_rule() for post querying custom fields
- Group custom post listing in admin section
- Plugin will sort users by usermeta
- problem with sql query in wordpress plugin
- Attempt to improve WP search, can someone check my SQL query?
- WordPress Query orderby title with UTF8 string in title
- Searching With Apostrophe
- Exclude all sticky posts front page twenty twelve
- What does the class look like that is returned from WP_User_Query?
- Query posts according to specific post meta values
- wpdb COALESCE won’t work
- get csv of users with user_meta
- empty query breaks other queries
- Problem in exploding the_content to array
- Query does not return content
- What is wrong with my wp query, cant exclude the category that i want
- Order users by user role
- how to insert missing tags into the posts through mySQL?
- Parse query filter in wordpress and relation
- How to write update query in WordPress to expire transients
- Query Nickname rather than Display Name in custom Woocommerce plugin
- get posts by tag to showing in a widget
- Get previous posts list
- how to replace old DW site with new WP site? [closed]
- Mysql query not working on WordPress 4.2.2
- WordPress SQL query to tag all posts containing a specific word on title
- Order terms by count – missing terms
- Querying Advanced Custom Fields
- How to rearrange a pool of posts joined using two queries?
- Display all authors in a theme template
- wpdb update multiple row?
- Can I include get_posts in this array?
- Is there a way to add a link directly into this media query?
- How to show list authors with at least five posts published
- Custom query Custom-Post-Types creates error
- Formatting a date/time returned from a custom $wpdb query
- Rewrite rule for query params
- Cannot get sql request from Query object?
- Hook into the Admin Dashboard and redirect users
- Displaying data from custom table
- SEO friendly query vars
- Question about of query
- Prevent versioning for .woff (font) files
- Orderby event date (if it exists) or post date (if it doesn’t) – how to reorder posts based on meta value OR date
- Modify behaviour of “s” parameter in wp_query
- OR condition not working
- Query not returning child posts for any parent post ID
- How to make MySQL search queries with quotes
- Limiting a filtered query
- Use $wpdb->get_results with filter based on array
- Add Hook for clearing transient when post is added
- Archive query not working correctly
- How to have more post in a page than in your home page
- Show links to child pages on both parent AND child pages
- Display old posts if no future posts exist
- Exclude Authors based off date of last post
- Exclude Author by ID
- Access Tables with number prefix
- Modify Global Posts Plugin
- How to reference same column name but different table in custom db query
- Retrieving custom field array value through db query
- how to add a read more button to my blog page?
- SQL Query : how copy all tags of post into their post content in wordpress by sql query
- 3 queries to update WordPress
- How to figure out correct wp_options to have autoload=’yes’