WordPress.org

Ready to get started?Download WordPress

Forums

Older/Newer Posts link not working (6 posts)

  1. friedmlh
    Member
    Posted 3 years ago #

    Just discovered this error on my blog. At the bottom of the homepage, there's an "older post" link. This link directs me to mysite/wordpress/page/2/, but it shows me the exact same posts as the homepage.

    I've trolled the forums here with no avail.

    Any suggestions here?

    site: http://theoffbeatreport.com

    Let me know if you need to see index.php.

    Thanks in advance!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Does your theme's index.php template file use a custom query? If so, it may need to be modified slightly.

  3. friedmlh
    Member
    Posted 3 years ago #

    I believe it does:

    <?php if ($counter%2 == 0 AND $small == TRUE ) { echo '<div style="clear:both;"></div>'; } ?>

    <?php endwhile; ?>
    <?php endif; ?>

    <div class="more_entries">
    <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
    <div class="fl"><?php previous_posts_link(__('« Newer Entries ',woothemes)) ?></div>

    <div style="float: right;">
    <?php next_posts_link(__(' Older Entries »',woothemes)) ?></div>

    Is that helpful? Thanks in advance!

  4. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Sorry - no. That's at the bottom of the Loop. A custom query would be just before the Loop.

  5. friedmlh
    Member
    Posted 3 years ago #

    Ah, correct. This is what's before the loop (at least what I think is necessary):

    query_posts($args);
    query_posts('cat=-334');

    $home_content = get_option('woo_home_content');
    $home_boxes = get_option('woo_home_boxes');

    if (have_posts()) :

    $full = FALSE;

    $width = get_option('woo_full_thumb_width');
    $height = get_option('woo_full_thumb_height');

    if( $home_boxes == 'On') { $small = TRUE; }
    elseif ($home_boxes == 'Off') { $full = TRUE; }
    else { $large_posts = intval($home_boxes); }

    $counter = 0;
    while (have_posts()) : the_post();
    $counter++;
    $post_class = 'full';
    if( ($counter > $large_posts OR $small == TRUE) AND $full == FALSE)
    {
    $width = get_option('woo_boxed_thumb_width');
    $height = get_option('woo_boxed_thumb_height');
    if( $small == FALSE ) $counter = 1;
    $small = true;
    if ($counter%2 == 0 ) { $post_class = 'fr'; }
    else { $post_class = 'fl'; }
    }

    ?>
    <div class="post-outer post <?php echo $post_class; ?>">

    <div class="post-inner post-alt">

    <?php woo_get_image('image',$width,$height); ?>

    <p class="category-head cufon"><?php the_category(', ') ?></p>
    <h2><?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></h2>
    <p class="title-meta"><span class="comments-head"><?php comments_popup_link(__('0 Comments',woothemes), __('1 Comment',woothemes), __('% Comments',woothemes)); ?></span> <span class="date"><?php the_time('d F Y'); ?></span></p>

    <?php if ($home_content == 'false') { ?>
    <p><?php echo strip_tags(get_the_excerpt(), ''); ?></p>
    <?php the_title(); ?>" href="<?php the_permalink() ?>"><?php _e('Want More?',woothemes); ?>
    <?php } else { ?>
    <?php the_content(__('Want More?',woothemes)); ?>
    <?php } ?>

    </div><!--/post-inner-->
    </div><!--/post-->

    Let me know if this is what you need. Thank you so much!

  6. MrSerginho
    Member
    Posted 3 years ago #

    I have the same problem on my blog: http://emisto.net with the pagenavi. Can somebody help me?

Topic Closed

This topic has been closed to new replies.

About this Topic