Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function ba_slider() {
- global $post;
- $args = array(
- 'post_type' => 'rotator',
- );
- $slides = new WP_Query($args);
- if ($slides->have_posts()) {
- ?>
- <div class="flexslider">
- <ul class="slides">
- <?php
- $i = 0;
- while ( $slides->have_posts() ) {
- $slides->the_post();
- $img = get_the_post_thumbnail($post->ID, 'ba_slider');
- $prev = ( $i !== 0 ) ? '<a class="prev" href="#">Back</a>' : '';
- $next = ( $slides->current_post == ( $slides->found_posts - 1 ) ) ? '' : '<a class="next" href="#">Next</a>'; ?>
- <li>
- <?php echo $img; ?>
- <div class="slidertext">
- <h3><?php the_title(); ?></h3>
- <p><?php the_content(); ?></p>
- <?php echo $prev . $next; ?>
- </li>
- <?php $i++;
- }
- ?>
- </ul>
- </div><?php
- }
- }
Add Comment
Please, Sign In to add comment