Problem with the meta_query
-
Hi
I’m working on a website that that sells tires for vehicules and i’m at the step where i must use custom fields for the client to be at ease. I’m using the meta_query for my custom field and everything works fine for normal custom fields. The problem is that I have a custom field with data that is stored inside an array and I have problems to make my query for that.
With a normal custom field, i’d do something like that:
‘meta_query’ => array(
array(
‘key’ => ‘size’,
‘value’ => ‘130’,
‘compare’ => ‘=’
)
)But if the data is inside an array, how can I query that?
The thing would look like that on my logic, but of course it doesn’t work:
‘meta_query’ => array(
array(
‘key’ => ‘specifications[“sub_key”]’,
‘value’ => ‘winter’,
‘compare’ => ‘=’
)
)Query like that doesn’t work but that’s exactly how I would like to use the query. So is there a way to achieve something like that?
Thank you
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
-
You are coding and writing your own code is not allowed here, so you need to take the friendly supportbot’s advice and make friends over at WordPress.ORG the keepers of the software you are using.
- The topic ‘Problem with the meta_query’ is closed to new replies.