Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Galeria Template
- */
- get_header(); ?>
- <?php get_header(); ?>
- <div id="scontent_wrap">
- <div id="scontent">
- <div id="block_content">
- <div class="text_block">
- <h2 class="nolink"><span></span><p>Zapraszamy do obejrzenia naszych produktów</p></h2>
- <span class="ldiver"/>
- </div>
- <?php
- global $post;
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $post_per_page = 25;
- $args= array(
- 'post_type' => 'produkty',
- 'posts_per_page' => $post_per_page,
- 'paged' => $paged
- );
- $images = get_children(array(
- 'post_parent' => $post->ID,
- 'post_status' => 'inherit',
- 'post_mime_type' => 'image'
- ) );
- $size = 'thumbnail';
- if ($images) {
- $num_of_images = count($images);
- $i = 0;
- foreach ($images as $image) {
- $img_title = $image->post_title;
- $img_url = wp_get_attachment_url($image->ID);
- $preview_array = image_downsize($image->ID, $size );
- $img_preview = $preview_array[0];
- }
- };
- $temp = $wp_query;
- $wp_query = null;
- $wp_query = new WP_Query(array($args+$images));
- if( have_posts() ) : while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
- <div id="prodpost">
- <div class="thmb">
- <a href="<?php echo $img_url; ?>"><?php echo $prewiev_array; ?></a>
- </div>
- <span></span>
- <div class="info">
- <h2 class="nolink"><p><?php echo $img_title; ?></p></h2>
- <?php the_excerpt(); ?>
- <h3><a class="more" href="<?php echo get_permalink(); ?>">WIĘCEJ<span id="more"></span></a></h3>
- </div>
- </div>
- <?php endwhile; ?>
- <div class="navigation">
- <div class="left more">
- <?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); ?>
- </div>
- <div class="sep"></div>
- <div class="right more">
- <?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); ?>
- </div>
- </div>
- <?php endif ?>
- </div>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment