Post by category+author not working!

Hi guys, someone know why this code is ignoring the author id and is giving to all logged user the same post, i want to show a single post related and published by logged user?

all user has a post in that category and i want to show the post owned by logged user

$current_user = wp_get_current_user();
$post_ref = get_posts( array( ‘author’ => $current_user->ID, ‘numberposts’ => 1, ‘cat’ => 31 ) );
foreach( $post_ref as $post ):
the_title(); echo get_the_ID();

Read more here:: Post by category+author not working!

Leave a Reply

Your email address will not be published. Required fields are marked *