Skip to content

Instantly share code, notes, and snippets.

@pedroelsner
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedroelsner/5897ff36f1296b90af2f to your computer and use it in GitHub Desktop.
Save pedroelsner/5897ff36f1296b90af2f to your computer and use it in GitHub Desktop.
Edson - Load page ID
<?
/**
* Carrega a API do WordPress
*/
define('WP_USE_THEMES', false); // Não utiliza nenhum tema
require('./wordpress/wp-load.php');
$query = new WP_Query( 'page_id=7' );
if ( $the_query->have_posts() ) {
// Achou a página
while ($query->have_posts()): $query->the_post();
echo '<h2>';
the_title();
echo '</h2>';
the_content();
endwhile;
} else {
// Página não encontrada
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment