Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( have_posts() ) : ?>
- <?php
- $start = time(); //Now
- $end= strtotime('+1 month'); //1 month ahead
- $args = array(
- 'post_type' => 'event',
- 'post_status' => 'publish',
- 'posts_per_page' => '10',
- 'meta_query' => array(
- array('key' => $prefix.'event_start_timestamp', 'value' => $start, 'compare' => '>=', 'type' => 'NUMERIC'),
- array('key' => $prefix.'event_end_timestamp', 'value' => $end, 'compare' => '<=', 'type' => 'NUMERIC')
- )
- );
- //new query
- $the_query = new WP_Query( $args );
- ?>
- <?php get_template_part( 'post_type', 'event' ); ?>
- <?php // The loop ?>
- <?php while ($the_query->have_posts() ) : $the_query->the_post(); ?>
- <?php endwhile; ?>
- <?php else : ?>
- <article id="post-0" class="post no-results not-found">
- <header class="entry-header">
- <h1 class="entry-title"><?php _e( 'Nothing Found', 'eventster' ); ?></h1>
- </header><!-- .entry-header -->
- <div class="entry-content">
- <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'eventster' ); ?></p>
- <?php get_search_form(); ?>
- </div><!-- .entry-content -->
- </article><!-- #post-0 -->
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement