Skip to content

Instantly share code, notes, and snippets.

@pedroelsner
Created July 23, 2012 00:00
Show Gist options
  • Save pedroelsner/3161421 to your computer and use it in GitHub Desktop.
Save pedroelsner/3161421 to your computer and use it in GitHub Desktop.
#1 - WP_query personalizado
<?php
// Seleciona todos os posts publicados
$query = new WP_query(
array(
'post_type' => 'post',
'post_status' => 'publish'
)
);
// Enquando houver post
while ($query->have_posts()) {
$query->the_post();
// Codificação normal do WordPress
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment