Skip to content

Instantly share code, notes, and snippets.

@sproutventure
Created October 13, 2010 15:54
Show Gist options
  • Save sproutventure/624314 to your computer and use it in GitHub Desktop.
Save sproutventure/624314 to your computer and use it in GitHub Desktop.
<?php
/*
Template Name: Loop template
*/
get_header();
?>
<div id="loop" class="grid_8 alpha clearfix">
<div id="content">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
//'cat' => 3, // Uncomment and add the category ID if you want to filter this loop.
'paged' => $paged,
);
$wp_query = new WP_Query($args);
get_template_part( 'loop', 'index' );
?>
</div><!-- #content -->
</div><!-- #container -->
<div id="default_sidebar" class="sidebar grid_4 omega clearfix">
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
@sproutventure
Copy link
Author

Save this file within your theme and it can be used to display a loop of posts. Useful if your theme/plugin config cannot support "Posts page" under the "Reading" settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment