WordPress.org

Ready to get started?Download WordPress

Forums

WordPress pagination showing same posts on every page with ajax. (1 post)

  1. David Powell
    Member
    Posted 3 years ago #

    I have a page that that is run on ajax. When the user selects to see older posts jquery calls the load() function and loads the next set of posts in a specified section.

    my jquery:

    jQuery('.moreButton a, .backButton a').live('click', function(e){
            e.preventDefault();
            var link = jQuery(this).attr('href');
            jQuery('.blogDisplay').fadeOut(200).load(link + ' .blogDisplay', function(){ jQuery('.blogDisplay').fadeIn(800); makeThumb();});
    
      });

    the section I have in the index:

    <?php
    query_posts('cat=-132');
    if (have_posts()):?>
    <?php while (have_posts()) : the_post(); ?>

    when the page loads first it shows the correct set of posts. when I choose to see the next set it always shows the same first set. However, when I remove the change in query_posts() to show all the posts it woks perfectly.

    Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic