Skip to content

Instantly share code, notes, and snippets.

@diogenesjup
Created May 6, 2016 22:35
Show Gist options
  • Select an option

  • Save diogenesjup/e21b795a756be06bfc7db94484fb0bd8 to your computer and use it in GitHub Desktop.

Select an option

Save diogenesjup/e21b795a756be06bfc7db94484fb0bd8 to your computer and use it in GitHub Desktop.
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$the_query = new WP_Query( 'post_type=Na-midia&paged='.$paged.'&posts_per_page=6' );
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post();
//AQUI O CONTEUDO
endwhile;
previous_posts_link('Página anterior', $the_query->max_num_pages)
next_posts_link('Próxima página', $the_query->max_num_pages)
wp_reset_postdata();
else :
_e( 'Nenhuma postagem cadastrada.' );
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment