I am using a page template with code to display all blog posts:
<?php /* Template Name: Blog */ ?>
<?php get_header(); ?>
<div id="main">
<?php
// ACF Page number variable
$numposts = get_field('number_of_posts_per_page');
$args = array( 'numberposts' => $numposts );
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post);
?>
<div class="blogpost clearfix">
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<span class="postdetails">
<?php the_time ('j F, Y'); ?> <span class="bullet">•</span> Posted by: <?php the_author(', '); ?> in: <?php the_category(', '); ?><?php the_tags( ' <span class="bullet">•</span>  Tags: ', ', ', '<br />' ); ?>
</span>
<?php the_content(); ?>
</div>
<?php endforeach; ?>
<?php wp_pagenavi(); ?>
</div>
<?php get_footer(); ?>
The problem I'm having is I cannot get any pagination to work. Above I have pagenavi installed but nothing appears. I have set the post limit to 5 in both my custom field (which shows 5, there are 6 posts) and in WP settings.
Can anyone shed any light? Thanks.