How do we display posts by a specific author or the current author?

Hi community,

Is there a way to display posts by a specific author? For instance, I want to show only posts where the author ID is 12. I would also like to be able to display posts by the current author. I thought this would be simple to do, but I haven’t found an option for it. Thanks in advance for any help.

Hi @Victor1999 ,

You can only use Query Editor or hook to add author / author__in to your query.

Example:

return [
  'author' => 12,
];

return [
  'author' => get_post_field( 'post_author',  '{post_id}' ) ),
];

return [
  'author' => '{wp_user_id}',
];

UI way will be added in the next beta release. It’s already in our beta branch.

Regards,
Jenn

1 Like