Paste2 Logo
  1. <?php
  2. /*
  3. Template Name: Gallery
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8.  
  9.                 <!--CENTER-->
  10.                 <div id="center" class="clearfix">
  11.                        
  12.                         <!--CONTENT-->
  13.                         <div id="content">
  14.  
  15.                                 <!--GALLERY-->
  16.                                 <div class="entry gallery clearfix">
  17.  
  18.                                         <?php $paged = intval(get_query_var('paged')); //pagenavi bug
  19.                                         if($paged == 0) {
  20.                                                 $paged = 1;
  21.                                         }
  22.                                         query_posts("showposts=15&paged=$paged"); ?>
  23.                         <?php $i = 0; ?>
  24.                         <?php if (have_posts()) : ?>
  25.                         <?php while (have_posts()) : the_post(); ?>
  26.        
  27.                                         <?php $fragmanSource = get_post_meta($post->ID, "fragman", true); ?>   
  28.                         <?php $post_images = post_gallery_get_images(); ?>
  29.                                         <?php $total_images = sizeof($post_images); ?>
  30.                                        
  31.                         <?php if ($fragmanSource != "" && $total_images > 0) : ?>
  32.                                 <?php $i++; ?>
  33.                                                 <!--TRAILER-->
  34.                                                 <div class="trailer"<?php if($i%3) { echo ''; } else { echo ' style="margin:0"';} ?>>
  35.                                                         <?php $trailerTitle = get_the_title(); ?>
  36.                                                         <h1><a href="<?php the_permalink() ?>" title="<?php echo $trailerTitle; ?>"><?php if (strlen($trailerTitle) >32) { echo substr($trailerTitle, 0, 31) . "&hellip;"; } else { echo $trailerTitle; } ?></a></h1>
  37.                                                         <a href="<?php echo $fragmanSource; ?>" class="thumb" rel="shadowbox[galeri];height=272;width=480">
  38.                                                                 <img src="/wp-content/plugins/post-gallery/thirdparty/phpthumb/phpThumb.php?src=/wp-content/plugins/post-gallery/uploads/<?php echo $post_images[0]['image_location']; ?>&amp;w=180&amp;h=200&amp;zc=1" class="alignleft" alt="<?php echo $post_images[0]['image_title']; ?>" />
  39.                                                                 <span></span>
  40.                                                         </a>
  41.                                                 </div>
  42.                                                 <!--/TRAILER-->
  43.                                                
  44.                                         <?php endif; ?>
  45.                                        
  46.                         <?php endwhile; ?>
  47.                                         <?php endif; ?>
  48.  
  49.                                 </div>
  50.                                 <!--/GALLERY-->
  51.  
  52.                 <!--PAGINATION-->
  53.                 <div id="pagination" class="clearfix">
  54.                     <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>  
  55.                 </div>
  56.                 <!--/PAGINATION-->
  57.                                
  58.                         </div>
  59.                         <!--/CONTENT-->
  60.                        
  61.             <?php get_sidebar(); ?>
  62.                        
  63.                 </div>
  64.                 <!--/CENTER-->
  65.  
  66. <?php get_footer(); ?>