I have this meta_query , which is:
A post type " newsletter " with a custom field I created called " date_newsletter " which would make the records of a year and month given specific and sort both by the " date_newsletter " field and also sort by the id of the post .
Meta_query but this did not work for me .
Any help?
$args = array(
'post_type' => 'newsletter',
'meta_query' => array(
array(
'key' => 'date_newsletter',
'value' => date("Y"),
'compare' => '=',
'value' => $y,
),
array(
'key' => 'date_newsletter',
'value' => date("m"),
'compare' => '=',
'value' => $m,
)
),
'meta_key' => 'date_newsletter',
'orderby' => 'meta_value',
'orderby' => 'id',
'order' => 'DESC',
'showposts' => '-1'