Guest User

Wordpress template

a guest
Jul 10th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.24 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Template Name: Galeria Template
  4.  */
  5.  
  6. get_header(); ?>
  7. <?php get_header(); ?>
  8. <div id="scontent_wrap">
  9.     <div id="scontent">    
  10.         <div id="block_content">
  11.             <div class="text_block">
  12.                 <h2 class="nolink"><span></span><p>Zapraszamy do obejrzenia naszych produktów</p></h2>
  13.                 <span class="ldiver"/>
  14.             </div>
  15.  
  16.             <?php
  17.             global $post;
  18.             $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  19.             $post_per_page = 25;
  20.             $args= array(
  21.             'post_type' => 'produkty',
  22.             'posts_per_page' => $post_per_page,
  23.             'paged' => $paged
  24.             );
  25.             $images = get_children(array(
  26.             'post_parent' => $post->ID,
  27.             'post_status' => 'inherit',
  28.             'post_mime_type' => 'image'
  29.             ) );
  30.             $size = 'thumbnail';
  31.             if ($images) {
  32.                 $num_of_images = count($images);
  33.                 $i = 0;
  34.                 foreach ($images as $image) {
  35.                     $img_title = $image->post_title;
  36.                     $img_url = wp_get_attachment_url($image->ID);
  37.                     $preview_array = image_downsize($image->ID, $size );
  38.                     $img_preview = $preview_array[0];
  39.                 }
  40.             };
  41.             $temp = $wp_query;
  42.             $wp_query = null;
  43.             $wp_query = new WP_Query(array($args+$images));
  44.             if( have_posts() ) : while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
  45.             <div id="prodpost">
  46.                 <div class="thmb">
  47.                     <a href="<?php echo $img_url; ?>"><?php echo $prewiev_array; ?></a>
  48.                    
  49.                  </div>
  50.                  <span></span>
  51.                  <div class="info">
  52.                     <h2 class="nolink"><p><?php echo $img_title; ?></p></h2>
  53.                         <?php the_excerpt(); ?>
  54.                         <h3><a class="more" href="<?php echo get_permalink(); ?>">WIĘCEJ<span id="more"></span></a></h3>
  55.                        
  56.                  </div>
  57.             </div>
  58.              <?php endwhile; ?>
  59.        
  60.              <div class="navigation">
  61.                 <div class="left more">
  62.                     <?php previous_posts_link('<div class="next"></div><div style="float:left"><h3 class="nolink" style="padding:10px 25px 0;">WSTECZ</h3></div>', $wp_query->max_num_pages); ?>
  63.                    
  64.                    
  65.                 </div>
  66.                 <div class="sep"></div>
  67.                 <div class="right more">
  68.                     <?php next_posts_link('<div style="float:left"><h3 class="nolink" style="padding:10px 25px 0;">DALEJ</h3></div><div class="prev"></div>', $wp_query->max_num_pages); ?>
  69.                 </div>
  70.             </div>
  71.        
  72.         <?php endif ?>
  73.         </div>
  74.     </div>
  75. </div>
  76.     <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment