Advertisement
Guest User

Untitled

a guest
Dec 11th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <!-- Nav tabs -->
  2. <ul class="nav nav-tabs">
  3. <?php
  4. $panel_id = 1;
  5. $args = array(
  6. 'post_type' => 'book',
  7. 'posts_per_page' => 8,
  8. 'orderby' => 'date',
  9. 'order' => 'ASC',
  10. );
  11. $book = new WP_Query( $args );
  12. while( $book->have_posts() ) : $book->the_post();
  13. ?>
  14. <li<?php if ( $book->current_post == 0 ): ?> class="active"<?php endif; ?>>
  15. <a href="#<?php echo $panel_id; ?>" data-toggle="tab"><?php the_title(); ?></a>
  16. </li>
  17.  
  18. <?php $panel_id++; endwhile; wp_reset_postdata(); ?>
  19. </ul>
  20. <!-- Tab panes -->
  21. <div class="tab-content">
  22. <?php
  23. $panel_id = 1;
  24. $args = array(
  25. 'post_type' => 'book',
  26. 'posts_per_page' => 8,
  27. 'orderby' => 'date',
  28. 'order' => 'ASC',
  29. );
  30. $book_2 = new WP_Query( $args );
  31. while( $book_2->have_posts() ) : $book_2->the_post();
  32. ?>
  33. <div class="tab-pane fade<?php if ( $book_2->current_post == 0 ): ?> in active<?php endif; ?>" id="<?php echo $panel_id; ?>">
  34. <div class="row">
  35. <div class="col-xs-4 col-sm-2">
  36. <?php the_post_thumbnail('thumbnail', array('class' => 'img-responsive img-thumbnail')); ?>
  37. </div>
  38. <div class="col-xs-8 col-sm-10">
  39. <?php the_content(); ?>
  40. </div>
  41. </div>
  42. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement