Created
October 28, 2011 16:49
-
-
Save glideranderson/1322742 to your computer and use it in GitHub Desktop.
Wordpress loop within template file
This file contains 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
<?php | |
$args = array( 'pagename' => 'contact'); | |
$loop = new WP_Query( $args ); | |
while ( $loop->have_posts() ) : $loop->the_post(); | |
?> | |
<h2><?= the_title();?></h2> | |
<p><?= the_content(); ?></p> | |
<?php endwhile; ?> | |
<?php wp_reset_query(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment