Arkadaşlar kolay gelsin, ekrana BLOG yazısı 2 kere basılıyor sanırım döngüden kaynaklı, bu kodu nasıl düzeltebilirim?
Teşekkürler
<?php } else { // if $category_id != 'latest': ?>
<div class="latestPost-category-options">
<h3 class="featured-category-title"><a href="<?php echo esc_url( get_category_link( $category_id ) ); ?>" title="<?php echo esc_attr( get_cat_name( $category_id ) ); ?>"><?php echo esc_html( get_cat_name( $category_id ) ); ?></a></h3>
<?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?>
<div class="content_wrap">
<?php } ?>
<?php
$j = 0;
$cat_query = new WP_Query('cat='.$category_id.'&posts_per_page='.$p osts_num);
if ( $cat_query->have_posts() ) : while ( $cat_query->have_posts() ) : $cat_query->the_post(); ?>
<article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>">
<?php mts_archive_post(); ?>
</article>
<?php
endwhile; endif; ?>
<?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?>
</div>
<?php } ?>
</div>
<div class="yazi">BLOG</div>
<?php wp_reset_postdata();
}
}
}
} else { //Paged
if( $mts_options['mts_home_layout'] == 'isotope-width') { ?>
<div class="content_wrap">
<?php } ?>
<?php $j = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>">
<?php mts_archive_post(); ?>
</article>
<?php endwhile; endif; ?>
<?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?>
</div>
<?php } ?>
<?php if ( $j !== 0 ) { // No pagination if there is no posts ?>
<?php mts_pagination(); ?>
<?php } ?>
<?php } ?>
</div>
</div>
<?php if( 'featured-width' != $mts_home_layout && 'isotope-width' != $mts_home_layout && 'full-width' != $mts_home_layout ) get_sidebar(); ?>
<?php get_footer(); ?>
2 Kere Çıkan Blog Yazısı Nasıl Düzeltilir?
1
●35