|
I think the problem is in the Inner Join statement.
JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id)
Doesn't make sense to join the catagory id on the post id. Should be catagory ID on Catagory ID.
Also, only use one set of quotes. " or ' . Don't mix and match them. they always give headaches.
|