WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Pagination (3 posts)

  1. arturocivit
    Member
    Posted 1 year ago #

    Hi everybody, having a problem with the pagination, I have the following loop:

    <?php query_posts('cat=5&offset=0&order=DSC&showposts=5'); ?>
    
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <div id="FeatPropTitles"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>" class="FeatLinkTitle"><b><?php the_title(); ?></b></a></div>
    
    <small>Featured on <?php the_time('F jS, Y') ?><!-- | <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> --></small>
    
    <br />
    
    <img src="<?php echo get_post_meta($post->ID, 'FeatImage', true); ?>" width="250" height="164" border="0" hspace="5" vspace="5" align="left">
    
    <div style="line-height:22px; text-align: justify;"><?php echo get_excerpt(); ?></div>
    
    <br />
    
    <div><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><img src="<?php print IMAGES; ?>/MoreInfoPhotosBtn.png" width="394" height="32" border="0"></a></div>
    
    <br /><br /><br /><br />
    
    <?php endwhile; endif; ?>
    
    <?php previous_posts_link(); ?> | <?php next_posts_link(); ?>

    But if you go here: http://goo.gl/yo3Ha and click on next page at bottom it is loading the exact same posts, what do you guys think it is wrong here?

    Thanks!

  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    another case of a custom query without the 'paged' parameter:
    http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters

    try:

    <?php query_posts('cat=5&order=DSC&showposts=5&paged='.get_query_var('paged')); ?>
  3. arturocivit
    Member
    Posted 1 year ago #

    Thank you so much, sorry about that paged parameter, thanks so much!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.