JeffEgg

Code that works for page movie blog page template

Feb 7th, 2012
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.64 KB | None | 0 0
  1. <?php  query_posts('category_name=movies&posts_per_page=10&meta_key=post_expiration&orderby=meta_value&order=ASC');
  2.             if (have_posts()) :
  3.                  while (have_posts()) : the_post();
  4.                     $expirationtime = get_post_custom_values('post_expiration');
  5.                     $featured_event_info = get_post_meta($post->ID, 'date_range', true);
  6.                     $featured_event_title = get_post_meta($post->ID, 'short_title', true);
  7.  
  8.                      if (is_array($expirationtime)) {
  9.                          $expirestring = implode($expirationtime);
  10.                      }
  11.            
  12.                      $secondsbetween = strtotime($expirestring)-time();
  13.                      if ( $secondsbetween > 0 ) { ?>
  14.                      
  15.                     <div id="post-<?php the_ID();?>" class="movie-blog-content">
  16.                         <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
  17.                             <h2><?php echo $featured_event_title; ?></h2>
  18.                             <p><?php echo $featured_event_info; ?></p>
  19.                             <?php if (has_post_thumbnail( $post->ID )): ?>
  20.                             <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ ); ?>
  21.                             <div class="movie-blog-img"><img src="<?php echo site_url(); ?>/scripts/timthumb.php?src=<?php echo $image[0]; ?>&w=160&h=200&zc=1" /></div>
  22.                             <?php endif; ?>
  23.                         </a>
  24.                      </div><!-- .movie-blog-content -->
  25.                      <?php }
  26.                  endwhile;
  27.             endif;
  28. ?>
Add Comment
Please, Sign In to add comment