I'm using this code to display the news on the home page of a site, but I wanted to display:
4 news from Cat1
+ 3 from Cat2
+ 3 from Cat3
<!-- NOTÍCIAS AMB -->
<?php
if (have_posts('order=DESC')) : while (have_posts('numberposts=10')) : the_post('category_name=cat1');
?>
<div class="nto-destaq row columns">
<div class="imgmin-noticias-box large-3">
<div class="imgmin-noticias-capa"></div>
<div class="imgmin-noticias">
<?php the_post_thumbnail( ); ?>
</div>
</div>
<div class="bar-noticias large-13 columns">
<h1 class="title-destaque"><a title="<?php the_title(); ?>" href="<?php echo get_permalink(); ?>">
<?php title_limite(55); ?>
</a></h1>
<div class="resumoPost">
<!-- ADICIONA O BLOCO RESUMO DO POST -->
<?php the_excerpt_max_charlength(180); ?>
</div>
<span> <a title="Ver o post completo de: <?php the_title(); ?>" href="<?php echo get_permalink(); ?>" class="plus-destaq"> + </a> </span>
<span class="post-date"><?php the_time( get_option( 'date_format' ) ); ?></span>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
This code only displays Cat1
, I tried to replicate the code by changing the the_post('category_name=cat1');
but there it gives an error and displays 10 posts 3 times of cat1
. How do I write without conflict? Can you do within that code yourself?