Hello all,
I am using query_posts() to retrieve some posts in a specific category. My code is like this:
$posts = query_posts("name=$name&category_name=$category_slug");
But the problem is it seems like the category_name parameter is ignored, just the name is looked at
Eg, I have a post with the name of "My Post" and its category is "cat1"; I also have another category which is "cat2". When I tried the code below, I guessed the post should NOT be retrieved, but it was still included in the result:
$name = 'My Post';
$category_slug = 'cat2'; // yes, 'cat2' for not including 'My Post'
$posts = query_posts("name=$name&category_name=$category_slug");
Please give me any clue. Thank you all so much!