Skip to content

Instantly share code, notes, and snippets.

@stompweb
Forked from anonymous/search.php
Last active October 10, 2016 12:24
Show Gist options
  • Save stompweb/89a54b95b0023cc859ca42991e1c1de2 to your computer and use it in GitHub Desktop.
Save stompweb/89a54b95b0023cc859ca42991e1c1de2 to your computer and use it in GitHub Desktop.
<?php
$args = array(
'posts_per_page' => 5,
'orderby' => 'post_title',
'order' => 'ASC',
'post_type' => 'tour',
'post_status' => 'publish',
'paged' => $paged
);
$sdate = !empty($_GET['sdate']) ? sanitize_text_field($_GET['sdate']) : 0;
if( '' != $sdate){
$start_date = date('Ymd', strtotime($sdate));
$args['meta_query'] = array(
'key' => 'date_and_price_date',
'value' => $start_date,
'compare' => '<=',
'type' => 'numeric',
);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment