• AJ

    (@ajisimplifymecom)


    here are my arguments for the get_posts function:
    ` $args = array(
    ‘posts_per_page’ => 99999,
    ‘post_type’ => ‘events’,
    ‘order’ => ‘ASC’,
    ‘orderby’ => ‘meta_value_num’,
    ‘meta_key’ => ‘day’,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘month’,
    ‘value’ => $month
    ),
    array(
    ‘key’ => ‘year’,
    ‘value’ => $year
    ),
    array(
    ‘key’ => ‘hide_calendar’,
    ‘value’ => false
    ),
    ),
    );
    `
    this used to work perfectly, now it returns no results. if i remove two of the meta_queries, it works, but with more than one, i get nothing. help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter AJ

    (@ajisimplifymecom)

    PS, i put the code in backticks as suggested, but it still displayed as above, sorry!

    Thread Starter AJ

    (@ajisimplifymecom)

    Code:

    $args = array(
    	'posts_per_page' => 99999,
    	'post_type' => 'events',
    	'order' => 'ASC',
    	'orderby' => 'meta_value_num',
    	'meta_key' => 'day',
    	'meta_query' => array(
    		array(
    			'key' => 'month',
    			'value' => $month
    		),
    		array(
    			'key' => 'year',
    			'value' => $year
    		),
    		array(
    			'key' => 'hide_calendar',
    			'value' => false
    		),
    	),
    );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple meta_query in get_posts returns no results’ is closed to new replies.