Skip to content

Instantly share code, notes, and snippets.

@brycejacobson
Created August 4, 2014 03:11
Show Gist options
  • Save brycejacobson/465f21ee36f4a69a51fb to your computer and use it in GitHub Desktop.
Save brycejacobson/465f21ee36f4a69a51fb to your computer and use it in GitHub Desktop.
Sermons Page
<?php
// WP_Query arguments
$args = array (
'post_type' => 'sermon',
'posts_per_page' => '12',
'post_parent' => 0
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
get_template_part( 'content', 'sermons' );
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment