-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeatured-news2.php
48 lines (43 loc) · 1.59 KB
/
featured-news2.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
40
41
42
43
44
45
46
47
48
<div id="featured-news-2" class="container featured-area">
<div class="col-md-12">
<?php if (get_theme_mod('kurama_fn_title2')) : ?>
<div class="section-title title-font">
<span><div><?php echo esc_html( get_theme_mod('kurama_fn_title2' ) ) ?></div></span>
</div>
<?php endif; ?>
<div class="featured-news-container">
<div class="fg-wrapper">
<?php
$count = 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 4,
'cat' => esc_html( get_theme_mod('kurama_fn_cat2',0) ),
'ignore_sticky_posts' => 1,
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) :
$loop->the_post();
if ( has_post_thumbnail() ) :
$image_data = wp_get_attachment_image_src( get_post_thumbnail_id( $loop->post->ID), 'kurama-thumb' );
$image_url = $image_data[0];
endif;
?>
<div class="fg-item-container col-md-3 col-sm-3 col-xs-6">
<div class="fg-item">
<a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>">
<img src="<?php echo $image_url; ?>">
<div class="product-details">
<h3><?php the_title(); ?></h3>
</div>
</a>
</div>
</div>
<?php
$count++;
endwhile; ?>
<?php wp_reset_query(); ?>
</div>
</div>
</div>
</div>