I need some help with displaying some specific WordPress posts.
User's on my site can click on an 'Add to favorite' link which will then store that post ID in the
user_meta table for that user as an array.
So when I put the following in my
author.php template page...
<?php print_r ($curauth->user_favourite_post) ; ?>
... it returns with this...
Array (  => 2387  => 1307  => 1149  => 1156  => 474  => 50  => 1131  => 1473  => 2388  => 2544 )
... which is all good. This is the post ID's that the user has 'Favorited'.
My question is, how can I display these posts on the author page? I have this...
<?php $my_query = new WP_Query(); $my_query->query(array( 'post__in' => array($curauth->user_favourite_post))); while ($my_query->have_posts()) : $my_query->the_post(); ?> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php endwhile; ?>
... But it just displays all of the posts and not the ones that have been 'Favorited' by the user. I've tried a number of different ways and they all just return every post.