Advertisement
Guest User

Untitled

a guest
Sep 28th, 2014
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.40 KB | None | 0 0
  1.           <div id="myCarousel" class="carousel slide">
  2.  <div class="carousel-inner">
  3.   <?php
  4.    $the_query = new WP_Query(array(
  5.                         'post__in' => get_option('sticky_posts'),
  6.                         'ignore_sticky_posts' => 1,
  7.     'posts_per_page' => 1
  8.     ));
  9.    while ( $the_query->have_posts() ) :
  10.    $the_query->the_post();
  11.   ?>
  12.    <div class="item active">
  13.     <?php the_post_thumbnail('large');?>
  14.     <div class="carousel-caption">
  15.      <h4><?php the_title();?></h4>
  16.      <p><?php the_excerpt();?></p>
  17.     </div>
  18.    </div><!-- item active -->
  19.   <?php
  20.    endwhile;
  21.    wp_reset_postdata();
  22.   ?>
  23.   <?php
  24.    $the_query = new WP_Query(array(
  25.                         'post__in' => get_option('sticky_posts'),
  26.                         'ignore_sticky_posts' => 1,
  27.     'posts_per_page' => 5,
  28.     'offset' => 1
  29.     ));
  30.    while ( $the_query->have_posts() ) :
  31.    $the_query->the_post();
  32.   ?>
  33.    <div class="item">
  34.     <?php the_post_thumbnail('large');?>
  35.     <div class="carousel-caption">
  36.      <h4><?php the_title();?></h4>
  37.      <p><?php the_excerpt();?></p>
  38.     </div>
  39.    </div><!-- item -->
  40.   <?php
  41.    endwhile;
  42.    wp_reset_postdata();
  43.   ?>
  44.  </div><!-- carousel-inner -->
  45.  <a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
  46.  <a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
  47. </div><!-- #myCarousel -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement