show pages based on meta key

I am trying to display pages from a specific category based on two parameters.

I want to show only those where the job_start_date is >= to todays date

Hide jobs of job_closing_date where ’80’,
‘meta_key’ => ‘job_start_date’,
‘orderby’ => ‘meta_value_num’,
‘order’ => ‘DESC’,
‘paged’ => get_query_var( ‘paged’ ),
‘posts_per_page’ => 5
);

Which obviously chucks out everything but I then tried to modify it like this but tells me there are no posts…

$args = array(
‘cat’ => ’80’,
‘meta_query’ => array(
array(
‘key’ => ‘job_start_date’,
‘value’ => date(‘Ymd’),
‘compare’ => ‘>=’
),
array(
‘key’ => ‘job_closing_date’,
‘value’ => date(‘Ymd’),
‘compare’ => ‘<=’
)
),
‘meta_key’ => ‘job_start_date’,
‘orderby’ => ‘meta_value_num’,
‘order’ => ‘DESC’,
‘paged’ => get_query_var( ‘paged’ ),
‘posts_per_page’ => 20
);

So I am a bit confused now, any help or pointers would be awesome 🙂

Read more here:: show pages based on meta key

Leave a Reply

Your email address will not be published. Required fields are marked *