div class section-content div class container div id homepage-latestne

 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
<div class="section-content">
<div class="container">
<div id="homepage-latestnews" class="carousel slide" >
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<?php
$args = array( 'post_type' => 'post', 'posts_per_page' => $total_posts, 'order' => 'DESC');
$zerif_customcategory_select = get_theme_mod('zerif_customcategory_select','');
$cat='';
if( !empty($zerif_customcategory_select) ):
$args['cat']='-'.$zerif_customcategory_select;
endif;
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<div class="col-sm-3 latestnews-box">
<div class="latestnews-img">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail(); ?>
<?php else: ?>
<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/blank-latestposts.png">
<?php endif; ?>
</a>
</div>
<div class="latesnews-content">
<h5 class="latestnews-title white-text"><?php the_title(); ?></h5>
<?php custom_the_excerpt(110,"&gt; Read more"); ?>
</div>
</div><!-- .latestnews-box"> -->
<?php
endwhile;
?>
</div>
</div>
</div>
</div>