Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Wrapper for slides -->
- <div class="carousel-inner" role="listbox">
- <?php
- $c = 0;
- $class = '';
- query_posts('category_name=slider&showposts=3');
- if ( have_posts() ) : while ( have_posts() ) : the_post();
- $c++;
- $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
- $url = $thumb['0'];
- if ( $c == 1 ) $class .= ' active';
- ?>
- <div class="item <?php echo $class; ?>">
- <img src="<?php echo $url; ?>" class="img-responsive" alt="...">
- <div class="carousel-caption">
- <h2><?php the_content() ?></h2>
- </div>
- </div>
- <?php
- endwhile;endif;
- wp_reset_query();
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement