Instead of that try using;
<?php get_userdata( $userid ); ?>
For example;
<?php
$user_info = get_userdata(1); // get info for user id '1'
$username = $user_info->user_login;
$first_name = $user_info->first_name;
$last_name = $user_info->last_name;
?>
For more details visit this link.
Related Posts:
- Why is this coming back as null? Thats wrong. There is one post
- Two loops on archive page
- Check if loop has any categories?
- How to make search for posts using get method?
- Wp_query with 2 meta keys and array of meta values
- WP_QUERY wrong ammount of posts
- Writing less unnecessary code with WordPress
- How to separate two columns from one content on a page template?
- WooCommerce | AJAX | Product Pagination | Help me implement Ajax Pagination
- Second WP_Query loop shows data from main query
- active link for most recent post on vertical tabs
- Can I force WP_Query to return no results?
- Multiple WP_Query loops with Pagination
- WP_Query and next_posts_link
- Order posts by ID in the given order
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- Get array of posts from the current archive page loop
- How can I save an array from a random post sequence for later use?
- How to place a loop within another loop?
- In loop: posts have thumbnail AND other variables
- How to order category.php loop by ‘meta_value’?
- Pagination/infinite scroll with WP_Query and multiple loops
- Add inline HTML to posts published within last 24hrs
- Move posts to top of WP_Query if in certain Taxonomy?
- Display different number of posts from one category on the different pages
- Pagination not working Search posts
- How to change a custom query into a standard loop?
- Can certain (site-crashing) limitations on WP_Query in shortcode be overcome?
- wordpress query in header won’t reset and corrupts other loops
- Implementing an OR statement to wordpress wp_query
- Get List of all the Authors
- 2 loops on page – one with orderby rand second orderby date
- Undefined WP_Query::has_posts()?
- WP_Query arguments to fetch custom post type posts which are in certain category?
- WP_Query loop within WP_Query loop
- Refine search results using WP_Query
- How to pass many ids in post__in?
- How to show subcategories using loop?
- Counter problem, infinite loop when post_per_page equals X
- Sub-loop / nested loops Best Practices
- Five posts from a category in footer
- Which method is faster to get a single post?
- Show Sticky Post at the top but do not show again in the loop?
- Any number in meta key (wp query)
- How to get all unique categories for posts in loop?
- How do I run through a WordPress loop called from a filter function?
- How do I get the title of a category in a custom loop?
- Order by empty custom field
- Out Of memory issue on post per page parameter
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Multiple filter conditions for WP_Query
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- Change query from cat id to slug or name?
- Using Wp_Query without the loop?
- Custom WP_Query id
- Assign custom parameter to each post in query
- Custom WP_Query doesn’t display all posts
- How to use WP_Query() on single.php?
- How can I prevent posts with no title showing up in my query?
- Loop increase in while loop not working
- posts archive page – closing WP_Query loop correctly [closed]
- AJAX Breaking Offset Argument In WP Query
- How does WP generate the default $query in WP_Query based on the URL?
- how to get category`s slug in WP_Query loop?
- How to remove only the latest sticky post from the loop
- How I can repeat 2 HTML templates in a WordPress Query?
- Function using get_posts() with tax_query not working when called from functions.php
- WP_Query not getting all posts, just tagged posts
- Offset WP_Query by negative 1
- WP_Query orderby random do not repeat infinite scroll – one loop
- Advise on Templates for Custom Queries
- Search.php gets metadata from first post
- Query WP Page for Buddypress Group Home [closed]
- $post in wp_query?
- How to pass the current content of $wp_query to a new page?
- How to make the ‘request’ filter work?
- Can I alter the main loop to ‘orderby’ a custom callback?
- Custom WordPress post query for displaying time-released content on website
- Avoid removing duplicate posts
- Regarding a custom loop and output HTML tags
- Repeat array inside array through while loop
- What’s causing an infinite loop?
- pages shortcode filtering by category
- Meta Query if Values Don’t Exist
- Get post Number with local loop and template
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- query_posts() doesn’t seem to be called in my page
- display post multiple times based on array of dates
- Problems with WP_Query, Loop, a condition and Posts per Page
- WP_Query secondary query failing
- Custom search (wp query by custom fields)
- Sorting is not working in WordPress WP_Query
- Add custom WP_Query after the first 3 posts
- Limit the number of posts from a specific category on index.php
- Next / previous posts link doesn’t show up with Posts 2 Posts
- Carousel Loop only duplicating
- How to show featured post first, then separate loop for other posts
- How to display posts from a specific term first then another posts from another terms using tax_query
- Show number of posts AND number on current page (cannot make it work)
- WP_query shortcode inside acf Repeater breaks the repeater loop