I created a Query post for a certain category
<div class="querypost-home" id="conteudo-home4">
<?php
$args = array(
'category_name'=>'oportunidades',
'numberposts'=>1,
'offset'=>3
);
$my_posts = get_posts($args);
if( $my_posts ):
foreach( $my_posts as $post ) : setup_postdata($post); ?>
<?php if ( has_post_thumbnail()) : ?>
<div class="img1"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(870,420)); ?></a></div>
<?php endif; ?>
<div class="titulo-query-home"><a href="<?php the_permalink(); ?>"><p><?php title_lenght(40) ?></p></a></div>
<div class="resumo-query-home"><p><?php echo get_excerpt(160); ?></p></div>
<?php
endforeach;
else:
?>
<p></p>
<?php endif; ?>
</div> <!-- query post -->
I put a class in this query so I can put a cool style in these query posts. Being that, when I do not add any posts, the query's BG still appears, but without content. Does anyone know how to hide the query when it has no posts in its offset?