Title: paging not working
Last modified: August 24, 2016

---

# paging not working

 *  [Tom De Smedt](https://wordpress.org/support/users/steven_gardner/)
 * (@steven_gardner)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/paging-not-working-3/)
 * I’m building my first plugin that adds some extra homepage templates to my theme.
   The problem is the paging is not loading older or newer posts and I’m not sure
   whats wrong.
 * Can you take a quick look at point me in the right direction.
 * Thanks
 * Query Loop on template
 *     ```
       $temp = $wp_query; $wp_query= null;
           $wp_query = new WP_Query(); $wp_query->query('showposts=7' . '&paged='.$paged);
   
           while ($wp_query->have_posts()) : $wp_query->the_post();
       ```
   
 * Call to navigation function (the function is part of theme not this plugin) at
   bottom of template
    `eryn_paging_nav()`
 * eryn_paging_nav() function code:
 *     ```
       if ( ! function_exists( 'eryn_paging_nav' ) ) :
       /**
        * Display navigation to next/previous set of posts when applicable.
        */
       function eryn_paging_nav() {
       	// Don't print empty markup if there's only one page.
       	if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
       		return;
       	}
       	?>
       	<nav class="navigation paging-navigation" role="navigation">
       		<h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'eryn' ); ?></h1>
       		<div class="nav-links">
   
       			<?php if ( get_next_posts_link() ) : ?>
       			<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'eryn' ) ); ?></div>
       			<?php endif; ?>
   
       			<?php if ( get_previous_posts_link() ) : ?>
       			<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'eryn' ) ); ?></div>
       			<?php endif; ?>
   
       		</div><!-- .nav-links -->
       	</nav><!-- .navigation -->
       	<?php
       }
       endif;
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [Tom De Smedt](https://wordpress.org/support/users/steven_gardner/)
 * (@steven_gardner)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/paging-not-working-3/#post-5991717)
 * An example of the problem:
 * [http://www.templateexpress.com/erynpro](http://www.templateexpress.com/erynpro)

Viewing 1 replies (of 1 total)

The topic ‘paging not working’ is closed to new replies.

## Tags

 * [paging](https://wordpress.org/support/topic-tag/paging/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [Tom De Smedt](https://wordpress.org/support/users/steven_gardner/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/paging-not-working-3/#post-5991717)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
