Advertisement
Guest User

new loop-slider.php

a guest
Nov 30th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  11.  
  12. <?php
  13. global $wp_query, $query_string;
  14. $paged = get_query_var( 'paged' );
  15. $args = array(
  16.  
  17. 'posts_per_page' => 4, //this does not appear to do anything, adjust the number of posts per page in functions.php
  18.  
  19. 'paged' => $paged,
  20.  
  21. 'ignore_sticky_posts' => 1,
  22.  
  23.  
  24. //add post id's here:
  25.  
  26. 'post__in' => array(1,10,15,7)
  27. );
  28.  
  29.  
  30. $args = wp_parse_args( $args, $wp_query->query );
  31.  
  32. ?>
  33.  
  34.  
  35.  
  36.  
  37. <?php query_posts( $args ); ?>
  38. <?php if( have_posts() ) : ?>
  39. <div id="ajax-content">
  40. <ul id="slides" class="kwicks">
  41. <?php while( have_posts() ) : the_post(); ?>
  42. <?php $thumbnail = null; ?>
  43. <?php if( has_post_thumbnail() ) : ?>
  44. <?php $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id(), 'slider-thumb' ); ?>
  45. <?php endif; ?>
  46. <li class="slide">
  47. <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; ?>>
  48. <div class="opacity"></div>
  49.  
  50.  
  51. <?/* default code links post to post content:
  52. <a class="overlay" href="<?php the_permalink(); ?>" rel="bookmark"> </a>
  53.  
  54. */?>
  55.  
  56.  
  57. <?/* this is the mod, links each post to respective category archive */?>
  58.  
  59. <a class="overlay" href="
  60. <?php
  61. $the_cat = get_the_category();
  62. $category_name = $the_cat[0]->cat_name;
  63. $category_link = get_category_link( $the_cat[0]->cat_ID );
  64. ?>
  65.  
  66. <?php echo $category_link ?>" title="<?php echo $category_name ?>">
  67.  
  68. <div class="entry-container">
  69.  
  70. <h3 style="color:#fff;"><?php echo $category_name ?></h3>"
  71. </div><!-- .entry-container -->
  72. </a>
  73.  
  74.  
  75.  
  76.  
  77. <?/* removed the post title and excerpt:
  78.  
  79. <div class="entry-container">
  80.  
  81.  
  82. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  83.  
  84. <div class="entry-summary">
  85. <?php the_excerpt(); ?>
  86.  
  87.  
  88. <div class="clear"></div>
  89.  
  90. </div><!-- .entry-summary -->
  91.  
  92. </div><!-- .entry-container -->
  93.  
  94. */?>
  95.  
  96.  
  97.  
  98.  
  99. </div><!-- .post -->
  100. </li>
  101. <?php $thumbnaill = null; ?>
  102. <?php endwhile; ?>
  103. </ul><!-- #slides -->
  104. <div class="clear"></div>
  105. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  106. <div id="nav-slider">
  107. <div class="nav-previous"><?php next_posts_link( '' ); ?></div>
  108. <div class="nav-next"><?php previous_posts_link( '' ); ?></div>
  109. </div><!-- #nav-above -->
  110. <?php endif; ?>
  111. <?php rewind_posts(); ?>
  112. </div><!-- #ajax-content -->
  113. <?php endif; ?>
  114. <?php wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement