Last active
August 29, 2015 14:05
-
-
Save pedroelsner/5897ff36f1296b90af2f to your computer and use it in GitHub Desktop.
Edson - Load page ID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/** | |
* 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