2
I’m using this code to display the news on the home page of a website, only I wanted to display:
4 news from Cat1
+ 3 of Cat2
+ 3 of 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 the Cat1
, I tried to replicate the code by changing the the_post('category_name=cat1');
but then gives an error and displays 10 posts 3 times from cat1
. How do I write without conflict? You can do it within the same code?