Support » Fixing WordPress » Older/Newer Posts not displaying

  • Resolved flint_and_tinder


    Hi all,

    Can anyone help with this problem.

    I have a WP site built here:

    I have an issue that the older/newer posts buttons aren’t displaying the next images in the database. It just keeps showing the first 5 posts regardless of which page you are on.

    For example,
    displays the same as

    I have added some code to the functions.php that makes sure those buttons are displayed only when their are other posts in that category archive. However regardless of whether I remove that or not, the issue still persists. This is the code I have used for that:

     * If more than one page exists, return TRUE.
    function show_posts_nav() {
    	global $wp_query;
    	return ($wp_query->max_num_pages > 1);

    Each drawing/painting category uses roughly the same code to display the posts. For the process of this question here is the code for the Animal page:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Can anyone see where I’m going wrong here and help me out? I’d greatly appreciate it.
    Link to the page the code above references is, once again, this:


Viewing 1 replies (of 1 total)
  • I appear to have fixed it by changing this:

    <?php query_posts('cat=5s&showposts=5'); ?>

    to this:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($y_string.'&cat=5&paged=' . $paged); ?>

    Can anyone see any problems in this?

Viewing 1 replies (of 1 total)
  • The topic ‘Older/Newer Posts not displaying’ is closed to new replies.