Skip to content

Instantly share code, notes, and snippets.

@JustinSainton
Created December 4, 2012 22:45
Show Gist options
  • Save JustinSainton/4209762 to your computer and use it in GitHub Desktop.
Save JustinSainton/4209762 to your computer and use it in GitHub Desktop.
<?php
$args = array(
'meta_key' => '_cs-expire-date',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => '_cs-expire-date',
'value' => time(),
'compare' => '>=',
'type' => 'DATE'
)
)
);
$event = new WP_Query( $args );
?>
<?php if ( $event->have_posts() ) : ?>
<?php while ( $event->have_posts() ) : $event->the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
@dsebao
Copy link

dsebao commented Sep 5, 2013

Hi Justin, i can´t get this to work in my query, does it this code work or is just for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment