get_posts() can take the argument tag ='tagname' or category='categoryname' but we cant club them together like get_posts(tag ='tagname'&category='categoryname') Any ideas to get out of this situation.. I need to get all posts that have a particular tag and it belongs to a particular category..
I did a little research on your problem and it seems that there is a workaround... seems to be a well known problem of Wordpress. I can't post links for the moment, so I'll paste you the solution found on the web: <?php global $post; $postsByTag = get_posts('tag=Actualité'); $postsByCat = get_posts('categorie=6'); $postsListe = array_intersect ($postsByTag, $postsByCat); foreach($postsListe as $post) : ?> ..... <?php endforeach; ?> Hope this is of any help! =)
i too had came across the same.. and it gave the error Catchable fatal error: Object of class stdClass could not be converted to string in