Forums

WP-Paginate
Plugin shows pagination correctly but links do no show older posts (3 posts)

  1. danrood
    Member
    Posted 5 months ago #

    Eric -

    Love your plugin. Was very easy to install. I followed the directions and installed the wp-pageinate plugin and inserted the code in my loop below. When the page renders it shows the pagination when I click on the link to go to the next the older posts do not show up on the page. I did notice that the page numbers change in the url. Can you please take a look at my loop code below and tell me if I did something wrong.
    I am a designer not a code guy. Any help would be much appreciated.
    Is this because I am just using a single category to show posts?

    code \\
    <!--event loop begin -->
    <?php query_posts('cat=3'); ?>
    <!--<?php if(have_posts()) : ?>-->

    <?php while(have_posts()) : the_post() ?>

    <h2>" title="Permanent link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h2>
    <div class="dliList"><?php the_excerpt(); ?></div>

    <?php endwhile; ?>
    <div class="navigation">
    <?php if(function_exists('wp_paginate')) {
    wp_paginate();
    } ?>
    </div>
    <?php else: ?>
    <?php wp_reset_query(); ?>
    <h3>Sorry, we could not find what you were looking for. </h3>
    <div><?php get_search_form(); ?></div>
    <?php endif; ?>

    \\

    http://wordpress.org/extend/plugins/wp-paginate/

  2. danrood
    Member
    Posted 5 months ago #

    the page is located at http://www.dlidev.com/events

  3. amax2222
    Member
    Posted 5 months ago #

    Hey Dan, it may have something to do with your query. I had a similar issue and replaced the usual query with the $wp_query (http://codex.wordpress.org/Class_Reference/WP_Query) and it started working as it should. Just make sure you create a new instance. I went for something like this.

    $args=array(
    				   'cat' => 4,
    				   'posts_per_page' => 12,
    				   'paged'=>$paged
    				);
    
    				$temp = $wp_query;
    				$wp_query= null;
    				$wp_query = new WP_Query();
    				$wp_query->query($args);

    and while ($wp_query->have_posts()) : $wp_query->the_post();

    hope it works for you

Reply

You must log in to post.

About this Plugin

About this Topic