Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $post;
- $args = array(
- 'category_name' => 'movies',
- 'posts_per_page' => '3',
- 'meta_key' => 'post_expiration',
- 'orderby' => 'meta_value',
- 'order' => 'ASC',
- );
- $the_query = new WP_Query( $args );
- while ( $the_query->have_posts() ) : $the_query->the_post();
- $expirationtime = get_post_custom_values('post_expiration');
- $featured_event_info = get_post_meta($post->ID, 'date_range', true);
- $featured_event_title = get_post_meta($post->ID, 'short_title', true);
- if (is_array($expirationtime)) {
- $expirestring = implode($expirationtime);
- }
- $secondsbetween = strtotime($expirestring)-time();
- if ( $secondsbetween > 0 ) { ?>
- <div class="featured-events-post">
- <a title='<?php echo $featured_event_title; ?>' href='<?php the_permalink() ?>' rel='bookmark'>
- <div class="featured-events-title"><?php echo $featured_event_title; ?></div>
- <div class="featured-events-shortdata"><?php echo $featured_event_info; ?></div></a>
- </div>
- <?php } endwhile; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement