$wpQuery = new \WP_Query(array(
'post_type' => 'page',
'category_name' => 'products',
'lang' => bgCurrentLangIso(),
'meta_key' => 'hgcf',
'orderby' => 'meta_value_num',
'meta_type' => 'NUMERIC',
'order' => 'DESC'
));
$metadata = get_post_meta($post->ID, 'hgcf', true);
$currentYear = $metadata['hg-aw-year'];
Ok, so I want to query by hg-aw-year, but the problem is that it's a metadata inside hgcf, how do you order by a metadata subfield? The above works, but doesn't give me the results I want. It creates duplicate posts and I am wondering if it's at all possible to query by hg-aw-year.