Skip to content

Instantly share code, notes, and snippets.

@eltondev
Last active November 30, 2015 22:54
Show Gist options
  • Save eltondev/4296946db9be8ffc4609 to your computer and use it in GitHub Desktop.
Save eltondev/4296946db9be8ffc4609 to your computer and use it in GitHub Desktop.
query_posts( array(
'post_type' => 'MINHA CATEGORIA',
'posts_per_page' => 5
)
);
while ( have_posts() ) : the_post();
OU
//PEGO A CATEGORIA 10 E FAÇO ELA EXIBIR 1
<?php $recent = new WP_Query("cat=10&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
//<?php the_excerpt(); ?>
<?php endwhile; ?>
OU
query_posts("MINHA-CATEGORIA");
while(have_posts()) : the_post();
?>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<?php the_post_thumbnail('medium'); ?>
<p><?php (Descrição da Imagem Destaque) ?></p>
endwhile;
wp_reset_query();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment