I am making a custom page where I need to display posts from authors and terms (categories). I tried with the built in WP_query arguments but I am not getting the result I want.

So I want to know how I can get all posts from X authors AND Y Categories (terms) using SQL directives and WP_Query.

I already read the codex http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query but I still dont quite get how SQL works. I know the basics but I dont know how to link terms and categories, etc...

Thanks in advance.

  • You should use the Core functions if at all possible. 1) what are your specific conditions, and 2) what is your code, and 3) why/how are the results not what you want? – s_ha_dum Feb 22 '14 at 22:24
  • The core functions wont work because when I use author__in and category__in for the WP_query argumentes, wordpress wont get the posts for the specified categories. It only gets the posta for the specified authors. – Gixty Feb 22 '14 at 22:40
  • You want the specified authors and the specified categories, not the specified authors in the specified categories? – s_ha_dum Feb 22 '14 at 22:44
  • Yes, i want the specified authors AND/OR the specified categories. – Gixty Feb 22 '14 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.