Advertisement
DerReuter

loop-slider.php

Mar 22nd, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.15 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The Loop when viewing in gallery mode
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Minimatica
  7.  * @since Minimatica 1.0
  8.  */
  9. ?>
  10. <?php
  11.     global $wp_query, $query_string;
  12.     $paged = get_query_var( 'paged' );
  13.     $args = array(
  14.         'posts_per_page' => 4,
  15.         'paged' => $paged,
  16.         'ignore_sticky_posts' => 1
  17.     );
  18.     $args = wp_parse_args( $args, $wp_query->query );
  19. ?>
  20. <?php query_posts( $args ); ?>
  21. <?php if( have_posts() ) : ?>
  22.     <div id="ajax-content">
  23.         <ul id="slides" class="kwicks">
  24.             <?php while( have_posts() ) : the_post(); ?>
  25.                 <?php $thumbnail = null; ?>
  26.                 <?php if( has_post_thumbnail() ) : ?>
  27.                     <?php $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id(), 'slider-thumb' ); ?>
  28.                 <?php endif; ?>
  29.                 <li class="slide">
  30.                     <div id="post-<?php the_ID(); ?>" <?php post_class(); ?><?php if( isset( $thumbnail ) ) : ?> style="background:url(<?php echo $thumbnail[0]; ?>) center no-repeat"<?php endif; ?>>
  31.                         <div class="opacity"></div>
  32.                        
  33.                         <?php if ( in_category('5') ) { ?>
  34.                             <a class="overlay" href="<?php the_permalink(); ?>" rel="bookmark"></a>
  35.                         <?php } else { ?>
  36.                             <a class="overlay" href="<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ); echo $image[0]; ?>" rel="colorbox"></a>
  37.                         <?php } ?>
  38.                         <div class="entry-container">
  39.                             <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="lightbox"><?php the_title(); ?></a></h2>
  40.                             <div class="entry-summary">
  41.                                 <?php the_excerpt(); ?>
  42.                                 <div class="clear"></div>
  43.                             </div><!-- .entry-summary -->
  44.                         </div><!-- .entry-container -->
  45.                     </div><!-- .post -->
  46.                 </li>
  47.                 <?php $thumbnaill = null; ?>
  48.             <?php endwhile; ?>
  49.         </ul><!-- #slides -->
  50.         <div class="clear"></div>
  51.         <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  52.             <div id="nav-slider">
  53.                 <div class="nav-previous"><?php next_posts_link( '' ); ?></div>
  54.                 <div class="nav-next"><?php previous_posts_link( '' ); ?></div>
  55.             </div><!-- #nav-above -->
  56.         <?php endif; ?>
  57.         <?php rewind_posts(); ?>
  58.     </div><!-- #ajax-content -->
  59. <?php endif; ?>
  60. <?php wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement