-1
Friends, I developed a code so that I can display the results of the last posts of a Wordpress site, but I would need only post related to a certain category not appear.
<?php
// Documentação completa em http://codex.wordpress.org/Class_Reference/WP_Query
$args = array(
'orderby' => 'date', //Ordernar por data
'posts_per_page' => 12, // Número de posts a exibir
);
$novo_loop = new WP_Query( $args );
if ( $novo_loop->have_posts() ) : while ( $novo_loop->have_posts() ) : $novo_loop->the_post();
?>
<a href="<?php echo get_permalink( $post->ID ); ?>">
<div class="col">
<div class="brand brand-bottom">
<img src="<?php the_post_thumbnail_url('full'); ?>" alt="<?php the_title(); ?>" title="Ir para página do <?php the_title(); ?>"/>
<h3 class="item-info-title"><?php echo substr(get_the_title(), 0, 27)?></h3>
<button class="botaodozap">Entrar no grupo</button>
</div>
</div>
</a>
<?php endwhile; else :?>
CASO NÃO EXISTA POSTS
<?php
endif;
// Reseta as queries
wp_reset_postdata();
?>
how could I implement this? I read something like https://developer.wordpress.org/reference/hooks/block_categories/