Last active
August 29, 2015 14:04
-
-
Save immanuelsun/772da67cd82922f3b4ad to your computer and use it in GitHub Desktop.
Revisions
-
immanuelsun revised this gist
Jul 26, 2014 . 1 changed file with 52 additions and 49 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,65 +1,68 @@ <!-- Featured Post Carousel --> <!-- The Query --> <?php $args = array( 'post_type' => 'post', 'category_name' => 'featured' ); $the_query = new WP_Query( $args ); ?> <div id="featured-posts" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <!-- Start the Loop --> <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); $the_count = $the_query->current_post; ?> <li data-target="#featured-posts" data-slide-to="<?php echo $the_count; ?>" <?php if($the_count == 0): ?>class="active"<?php endif; ?> ></li> <!-- End the Loop --> <?php endwhile; endif; ?> </ol> <?php rewind_posts(); ?> <!-- Wrapper for slides --> <div class="carousel-inner"> <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); $the_count = $the_query->current_post; $attachment_id = get_post_thumbnail_id(get_the_ID()); $attachment_meta = wp_prepare_attachment_for_js( $attachment_id ); $image_url = $attachment_meta['url']; $image_caption = $attachment_meta['caption']; $image_description = $attachment_meta['description']; $image_alt = $attachment_meta['alt']; ?> <div class="item <?php echo $the_count; ?> <?php if($the_count == 0): ?>active<?php endif; ?>"> <a href="<?php the_permalink(); ?>"><img class="carousel-image" src="<?php echo $image_url; ?>" alt="<?php echo $image_alt; ?>"></a> <div class="carousel-caption"> <h5><?php the_title(); ?></h5> <p><?php echo $image_description; ?></p> </div> <!--/ carousel-caption --> </div> <!-- End the Loop --> <?php endwhile; endif; ?> </div> <!--/ carousel-inner --> <!-- Controls --> <a class="left carousel-control" href="#featured-posts" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#featured-posts" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> <!--/ #featured-posts carousel slide --> -
immanuelsun revised this gist
Jul 26, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ <!-- Featured Post Carousel --> <!-- The Query --> <?php $args = array( 'post_type' => 'post', 'category_name' => 'featured' @@ -55,11 +55,11 @@ <?php endwhile; endif; ?> </div> <!--/ carousel-inner --> <!-- Controls --> <a class="left carousel-control" href="#featured-posts" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#featured-posts" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> <!--/ #featured-posts carousel slide --> -
immanuelsun created this gist
Jul 26, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,65 @@ <!-- Featured Post Carousel --> <!-- The Query --> <?php $args = array( 'post_type' => 'post', 'category_name' => 'featured' ); $the_query = new WP_Query( $args ); ?> <div id="featured-posts" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <!-- Start the Loop --> <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); $the_count = $the_query->current_post; ?> <li data-target="#featured-posts" data-slide-to="<?php echo $the_count; ?>" <?php if($the_count == 0): ?>class="active"<?php endif; ?> ></li> <!-- End the Loop --> <?php endwhile; endif; ?> </ol> <?php rewind_posts(); ?> <!-- Wrapper for slides --> <div class="carousel-inner"> <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); $the_count = $the_query->current_post; $attachment_id = get_post_thumbnail_id(get_the_ID()); $attachment_meta = wp_prepare_attachment_for_js( $attachment_id ); $image_url = $attachment_meta['url']; $image_caption = $attachment_meta['caption']; $image_alt = $attachment_meta['alt']; ?> <div class="item <?php echo $the_count; ?> <?php if($the_count == 0): ?>active<?php endif; ?>"> <a href="<?php the_permalink(); ?>"><img class="carousel-image" src="<?php echo $image_url; ?>" alt="<?php echo $image_alt; ?>"></a> <div class="carousel-caption"> <?php the_title(); ?> </div> </div> <!-- End the Loop --> <?php endwhile; endif; ?> </div> <!--/ carousel-inner --> <!-- Controls --> <a class="left carousel-control" href="#featured-posts" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#featured-posts" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> <!--/ #featured-posts carousel slide -->