I have a blog page at: mysite.com/blog. On this page I have this loop:
<?php
$args = array (
'pagination' => true,
'paged' => 'pages',
'posts_per_page' => '5',
'ignore_sticky_posts' => true
);
?>
<?php $query = new WP_Query( $args ); ?>
<?php if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_title('<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?>
<p class="byline">
<span class="author vcard"><?php the_author_posts_link(); ?></span> <span class="sep">|</span>
<abbr class="published" title="<?php the_time(__('l, F jS, Y, g:i a', 'example')); ?>"><?php the_time(__('F j, Y', 'example')); ?></abbr>
<?php edit_post_link(__('Edit', 'example'), ' <span class="sep">|</span> <span class="edit">', '</span> '); ?>
</p>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages('before=<p class="pages">' . __('Pages:','example') . '&after=</p>'); ?>
</div>
<p class="entry-meta">
<span class="categories"><?php _e('Posted in', 'example'); ?> <?php the_category(', '); ?></span>
<?php the_tags('<span class="tags"> <span class="sep">|</span> ' . __('Tagged', 'example') . ' ', ', ', '</span>'); ?>
<span class="sep">|</span> <?php comments_popup_link(__('Leave a response', 'example'), __('1 Response', 'example'), __('% Responses', 'example'), 'comments-link', __('Comments closed', 'example')); ?>
</p>
Which works as expected, however I cannot get pagination to work. I have tried a variety of options. Any help is appreciated.