@robparker
Active 9 years, 11 months ago
-
Henry Wright replied to the topic [Resolved] Using bp displayed user to query posts in the forum How-to & Troubleshooting 10 years, 2 months ago
Hi @robparker,
May I ask why you’re querying by username and not by user ID?
You can simply use the
author
parameter withWP_Query
. Using what you linked to as an example:$args = array(
'posts_per_page' => 10,
'paged' => $paged,
'ignore_sticky_posts' => 1,
'author' => $user_id
);
$query = new WP_Query( $args );Where
$user_id
…[Read more]