I have query to show upcoming competitions

$today = strtotime(date( 'Y-m-d' ));
 $args = array(
     'post_type'=>array('posts', 'competition'),
     );
 query_posts($args);

It worked, but I wanted show only not ended ones, so I added this

$today = strtotime(date( 'Y-m-d' ));
 $args = array(
     'post_type'=>array('posts', 'competition'),
     'meta_query' => array(
        array(
            'key' => 'competition-end-date',
            'value' => $today,
            'compare' => '>=',
            'type' => 'DATE'
        )
       )
     );
 query_posts($args);

I needed this, because I want to show only those, which is not ended. Can someone say, why It`s not giving me results?

Read more here: Why my query not giving results?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: