0
Friends I have a menu with the following links from Categories Products and News I want you to click on any of the links and my page Category.php return only the posts of the category to which it was clicked.
I have on my page single_cat_title(); which returns the category name, I would like to know how to get the ID of this category to use in the $args array
$args = array('post_type'=>'post', 'Category'=>CODIGO_CATEGORIA, 'showposts'=>3);
<div class="container">
<?php
$args = array('post_type'=>'post', 'category'=>single_cat_title(), 'showposts'=>3);
$my_posts = get_posts( $args );
if($my_posts) : foreach($my_posts as $post) : setup_postdata( $post );
?>
<div class="row">
<div class="col-md-3 col-lg-3">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(false, array('class'=>'img-responsive img-post-blog')); ?></a>
</div>
<div class="col-md-9 col-lg-9">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</div>
</div>
<?php
endforeach;
endif;
?>
</div>