query_posts, get post by second category
-
In my sidebar I am trying to retrieve a list of posts from a certain category with query_posts.
$query = "cat=5&showposts=3"; $posts = query_posts($query);
This is working well except for posts that are assigned to more than one category.
For example:
Post a,b,c are in category 5 and post d is in category 4 and 5.
Now my query doesn’t return post d.Is there a way to make this work?
By the way these posts with multiple categories do get displayed when queried in the normal loop for example when I use https://www.domainname.com/?cat=5
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘query_posts, get post by second category’ is closed to new replies.