Skip to content

Instantly share code, notes, and snippets.

@diogenesjup
Created April 21, 2016 00:09
Show Gist options
  • Select an option

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

Select an option

Save diogenesjup/71d2028fbe51ba1c2a271b36c89dccb7 to your computer and use it in GitHub Desktop.
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$the_query = new WP_Query( 'post_type=Na-midia&paged='.$paged.'&showposts=6&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