-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeatured-area1.php
39 lines (35 loc) · 1.49 KB
/
featured-area1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<div id="featured-area-1">
<div class="container-fluid">
<?php if ( get_theme_mod('kurama_box_enable') && is_front_page() ) : ?>
<div class="popular-articles col-md-12">
<?php /* Start the Loop */ $count=0; ?>
<?php
$args = array( 'posts_per_page' => 4, 'category' => get_theme_mod('kurama_box_cat') );
$lastposts = get_posts( $args );
foreach ( $lastposts as $post ) :
setup_postdata( $post ); ?>
<div class="col-md-3 col-sm-6 col-xs-6 imgcontainer">
<div class="popimage">
<?php if (has_post_thumbnail()) : ?>
<a href="<?php the_permalink() ?>"><?php the_post_thumbnail('kurama-pop-thumb'); ?></a>
<?php else : ?>
<a href="<?php the_permalink() ?>"><img src="<?php echo get_template_directory_uri()."/assets/images/placeholder2.jpg"; ?>"></a>
<?php endif; ?>
<div class="titledesc">
<h2><a href="<?php the_permalink() ?>"><?php echo the_title(); ?></a></h2>
<span class="readmore title-font"><a href="<?php the_permalink() ?>"><?php _e('More Info','kurama') ?></a></span>
</div>
</div>
<!--<div class="postdate">
<span class="day"><?php the_time('j'); ?></span>
<span class="month"><?php the_time('M'); ?></span>
</div> -->
</div>
<?php $count++;
if ($count == 4) break;
endforeach; ?>
<?php wp_reset_postdata(); ?>
</div>
<?php endif; ?>
</div><!--.container-->
</div>