Advertisement
Guest User

Untitled

a guest
Jul 28th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <?php $cats = get_categories();
  2. foreach ($cats as $cat) {
  3. $cat_id = $cat->term_id;
  4. echo '<div class="'.$cat->name.'">';
  5. echo '<h3>'.$cat->name.'</h3>';
  6. echo '<a href="'.$category_link = get_category_link( $category_id ).'" class="pull-right">View more <span class="fa fa-angle-double-right"></span></a>';
  7. echo '<ul class="recent-works row">';
  8. query_posts("cat=$cat_id&post_per_page=4");
  9. if (have_posts()) : while (have_posts()) : the_post(); ?>
  10. <?php
  11. $classes = array(
  12. 'col-xs-12',
  13. 'col-sm-6',
  14. 'col-md-3'
  15. );
  16. ?>
  17. <li <?php post_class( $classes ); ?> id="post-<?php the_ID(); ?>">
  18. <a href="<?php $thumb_id = get_post_thumbnail_id( $post->ID );?>
  19. <?php $image = wp_get_attachment_image_src( $thumb_id,'full' ); ?>
  20. <?php echo $image[0]; ?>" data-gallery>
  21. <?php the_post_thumbnail('large', array('class' => 'img-responsive')); ?>
  22. </a>
  23. </li>
  24. <?php endwhile; endif; ?>
  25. </ul>
  26. </div>
  27. <?php }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement