0
I’m trying to make a loop just the category I’m in Wordpress and I’m not getting. Somebody give me a light? I’m trying to file Archive.php of the theme.
obs. Should display only posts in the open category.
Below the code of my Archive.php:
<?php
if (is_home()){
query_posts("showposts=5&cat=1,2,3,4,5,6,7,8,9,10,11,12"); while(have_posts()) : the_post(); ?>
<div class="LatestPosts">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
<div class="TxtNotice">
<?php //echo excerpt('20'); ?> <?php echo the_title(); ?>[...]
</br>
</a>
</div>
<?php
endwhile; wp_reset_query(); }?>
Try it this way:
$query = new wp_query( array( 'cat' => '1,2,3,4,5,6,7,8,9,10,11,12' ) );
– fernandoandrade
Thanks for the feedback Fernando, but in my case I want to bring only the posts of the category I am.
– Felipe Edwards Vanstocher