Questions tagged [meta-query]

103 questions
0
votes
2 answers

Multiple WP_Query args combinations according to post type

I'd like to have separate meta_query arguments according to the post type. For example, I'd like to query t-shirts that have a green collar or dress-shirts that have a green inner-lining, right now I only do a single post type check where I check…
martin schwartz
  • 863
  • 8
  • 17
0
votes
2 answers

get orders by custom field (meta data)

I want to loop through my orders and get only the orders with a specific custom field and value. function lwb_5483845() { $args = array( 'limit' => 9999, 'return' => 'ids', 'meta_query' => array( 'key' =>…
LovinQuaQua
  • 111
  • 2
  • 12
0
votes
1 answer

Wordpress wp_query: Order by meta_query key & then everything else by date (pinned / sticky)

I've been racking my brain over this for hours and now it's time to take it to Stack overflow. I'm aware there's no easy way to do this and probably there is not a way to do this at all. Using Wordpress, I'm trying to query posts but order them in a…
Sandy Garrido
  • 168
  • 5
  • 21
0
votes
1 answer

How to get all posts if post don't have specific meta key?

I'm trying to add post filters based on specified post metadata. Filters works great but when I select "All types" filter doesn't reset and no posts are displayed. HTML: