Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.30 KB | None | 0 0
  1. <!-- Wrapper for slides -->
  2.                           <div class="carousel-inner" role="listbox">
  3.  
  4.                             <?php
  5.                                 $c = 0;
  6.                                 $class = '';
  7.                                 query_posts('category_name=slider&showposts=3');
  8.                                 if ( have_posts() ) : while ( have_posts() ) : the_post();
  9.                                 $c++;
  10.  
  11.                                 $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
  12.                                 $url = $thumb['0'];
  13.  
  14.                                 if ( $c == 1 ) $class .= ' active';
  15.                                 ?>
  16.                                   <div class="item <?php echo $class; ?>">
  17.                                     <img src="<?php echo $url; ?>" class="img-responsive" alt="...">
  18.                                     <div class="carousel-caption">
  19.                                       <h2><?php the_content() ?></h2>
  20.                                     </div>
  21.                                   </div>
  22.                                 <?php
  23.                                 endwhile;endif;
  24.                                 wp_reset_query();
  25.                             ?>
  26.  
  27.  
  28.                          </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement