Jump to content

Wordpress problem (blog posts on second page repeat)


lockdownd7

Recommended Posts

I've got a wordpress blog set up, everything's great, however, now that I have more than 10 blog posts, it obviously adds the "next page" link at the bottom so users can go back and look at older entries.  However, when you click this link, although it goes to page 2, it simply repeats the most recent 10 posts, which is obviously redundant and wrong.

 

I would really appreciate any help anyone can provide.  Even if you don't know what the problem is, if you can recommend a workaround for it in the meantime, that would be fine.  :)

 

Here is the code from the index.php file.  I'm not sure that this is where the error is, so if you need to see other code, let me know.

 

<?php include_once('header-index.php'); ?>

 

<div id="midle" class="fl mgright">

<div class="spacer">

 

<?php if (have_posts()) : ?>

<?php query_posts('cat=all'); ?>

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

 

 

 

<div class="post" id="post-<?php the_ID(); ?>">

<h2><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<div class="postdata">

  <ul>

    <li class="time"><?php the_time('F jS, Y') ?></li>

<li class="posted">Posted in <?php the_category(', ') ?></li>

<li><?php edit_post_link('Edit', '', ''); ?></li>

  </ul>

  </div>

<?php the_content('<img src="' . get_bloginfo('template_url') . '/img/rmore.gif" alt="'. get_the_title() .'" />', '', '');?>

<div class="clr"></div>

</div>

 

 

<?php endwhile; ?>

 

<div id="navigation">

<div class="alignleft"><?php previous_posts_link('<img src="' . get_bloginfo('template_url') . '/img/prev.gif" alt="previous post" />', '', '') ?></div>

<div class="alignright"><?php next_posts_link('<img src="' . get_bloginfo('template_url') . '/img/next.gif" alt="next post" />', '', '') ?></div>

<div class="clr"></div>

</div>

 

<?php else : ?>

<div class="post">

<h2 class="center">Not Found</h2>

<p class="center">Sorry, but you are looking for something that isn't here.</p>

</div>

 

<?php endif; ?>

 

</div>

</div>

 

<?php get_sidebar(); ?>

 

<?php get_footer(); ?>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.