How can I get loop of posts by meta values that save in a meta_key that is an array like that
$sharedHosting_plans_fields = Array
(
[0] => Array
(
[plan_name] => name 1
[plan_price] => 1
[theType] => yesPaid
[plan_space] => Unlimited
)
[1] => Array
(
[plan_name] => name 2
[plan_price] => 3
[theType] => yesFree
[plan_space] => 5000
)
[2] => Array
(
[plan_name] => name2
[plan_price] => 5
[theType] => yesPaid
[plan_space] => Unlimited
)
)
And I have used this
'meta_key' => 'sharedHosting_plans_fields',
'orderby' => 'meta_value_num meta_value ',
but no effect!!!
2-If i want to get posts by checking multiple meta keys like that
array(
'key' => 'plan_type2'
),
array(
'key' => 'plan_type3'
),
array(
'key' => 'plan_type4'
),
array(
'key' => 'plan_type5'
),
How I can short hand this code by for loop or any thing else?
I have tried to use
'meta_key' => array('sharedHosting_plans_fields'),
'orderby' => 'meta_value_num meta_value ',
instead of
'meta_key' => 'sharedHosting_plans_fields',
'orderby' => 'meta_value_num meta_value ',
but no luck