Forums

blog next page not showing all post...please HELP (3 posts)

  1. obakitch
    Member
    Posted 2 years ago #

    I have a blog that I want to use on my site when you click on the BLOG link the page will show the 5 most recent post but when you click on the NEXT link it will go to a new page but will continue the to show the same 5 post and my images are missing the link and the code is below thank you in advance for your help

    http://rebelvision.com/newrebel/blog

    <?php query_posts('showposts=5&cat=-4,-5,-6'); ?>
    <?php if (have_posts()) : ?>

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

    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <h2>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h2><p>
    <p><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></p>
    <?php the_excerpt('Read the rest of this entry »'); ?><p>
    <p><?php the_tags('Tags: ', ', ', '
    '); ?> Posted in <?php the_category(', ') ?> </p>
    </div>
    <p>
    <?php endwhile; ?>

    <?php if (next_posts_link() || previous_posts_link()): ?>
    <?php next_posts_link('« Older Entries') ?> | <?php previous_posts_link('Newer Entries »') ?>
    <?php endif ?>

    <?php else : ?>

    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn't here.</p>
    <?php get_search_form(); ?>

    <?php endif; ?>

  2. alchymyth
    The Sweeper
    Posted 2 years ago #

    try to change this line:

    <?php query_posts('showposts=5&cat=-4,-5,-6'); ?>

    into these by adding the paged parameter:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    query_posts('showposts=5&cat=-4,-5,-6&paged='.$paged); ?>

    http://codex.wordpress.org/Template_Tags/query_posts

  3. obakitch
    Member
    Posted 2 years ago #

    Thanks Alchymyth that worked I truly appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags