Skip to content

Instantly share code, notes, and snippets.

@andrewlaskey
Last active August 29, 2015 14:01
Show Gist options
  • Save andrewlaskey/2724fbb5e0425eef0a2f to your computer and use it in GitHub Desktop.
Save andrewlaskey/2724fbb5e0425eef0a2f to your computer and use it in GitHub Desktop.
Basic wordpress loop for blog archive pages
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts( array(
'post_type' => 'post',
'paged' => $paged,
'posts_per_page' => 10
)
);
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment