Featured Posts
-
In the Home.php of the Magazine theme is code to maybe display a carousel of featured posts: just what I am looking for! How can we activate this function? I don’t see how!
Here is the code I found:if(!is_paged()) : $featured_posts = magazine_get_featured_posts(); if ( $featured_posts->have_posts() ) : echo '<div id="carousel-example-generic" class="carousel slide entry">'; $indicator ='<!-- Indicators --> <ol class="carousel-indicators">'; $slide = '<!-- Wrapper for slides --> <div class="carousel-inner">'; $counter = 0; while ( $featured_posts->have_posts() ) { $featured_posts->the_post(); $indicator .='<li data-target="#carousel-example-generic" data-slide-to="'.$counter.'" class="'. ($counter == 0 ? 'active' : '') .'"></li>'; $slide .='<div class="item '. ($counter == 0 ? 'active' : '') . '"> '. get_the_post_thumbnail( get_the_id(), 'sticky' ) .' <div class="carousel-caption transparent"> <h4 class="notransparent"><a class="notransparent" href="'.get_permalink().'">'. get_the_title() .'</a></h4> </div> </div>'; $counter++; } //echo $indicator.'</ol>'; echo $slide.'</div>'; echo '<!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"> <span class="icon-prev"></span> </a> <a class="right carousel-control" href="#carousel-example-generic" data-slide="next"> <span class="icon-next"></span> </a>'; echo '</div>'; endif;
- The topic ‘Featured Posts’ is closed to new replies.