Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $cats = get_categories();
- foreach ($cats as $cat) {
- $cat_id = $cat->term_id;
- echo '<div class="'.$cat->name.'">';
- echo '<h3>'.$cat->name.'</h3>';
- echo '<a href="'.$category_link = get_category_link( $category_id ).'" class="pull-right">View more <span class="fa fa-angle-double-right"></span></a>';
- echo '<ul class="recent-works row">';
- query_posts("cat=$cat_id&post_per_page=4");
- if (have_posts()) : while (have_posts()) : the_post(); ?>
- <?php
- $classes = array(
- 'col-xs-12',
- 'col-sm-6',
- 'col-md-3'
- );
- ?>
- <li <?php post_class( $classes ); ?> id="post-<?php the_ID(); ?>">
- <a href="<?php $thumb_id = get_post_thumbnail_id( $post->ID );?>
- <?php $image = wp_get_attachment_image_src( $thumb_id,'full' ); ?>
- <?php echo $image[0]; ?>" data-gallery>
- <?php the_post_thumbnail('large', array('class' => 'img-responsive')); ?>
- </a>
- </li>
- <?php endwhile; endif; ?>
- </ul>
- </div>
- <?php }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement