• I’m trying to put together a portfolio on my site that groups posts based on categories, and I need some help with the custom SELECT query to make it happen.

    Every post I want to show up in my portfolio page is put into a category called “Portfolio”, as well as several specific categories. Therefore, I am needing to come up with a SELECT query that has the following form:

    (pseudo-SQL)
    “SELECT * FROM posts WHERE category = ‘(Category1 || Category2 || Category3) && Portfolio'”

    But my SQL is a little rusty. Can I get some help? 🙂

Viewing 1 replies (of 1 total)
  • Thread Starter zenwebb

    (@zenwebb)

    *bump*. Still having issues with this.

    I’ve come across the WP_Query documentation and found the “cateogory__and” and “category__in” operators, but no mention of constructing complex queries using both. I almost need something that is nested, such as “category__and( category__in(1,2,3), 4)”. Any ideas?

Viewing 1 replies (of 1 total)
  • The topic ‘Help with constructing custom select query for posts’ is closed to new replies.