Reverse order of posts in archives bug?
-
Useful info:
WP ver: 2.1.3
Site: https://www.viewfindergallery.com/
If you get asked for a user and pass, use view and find respectively.OK, I have put in previous and next links using the previous_post_link and next_post_link functions respectively on the single.php template.
Correct me if I’m wrong, but wp’s default order for posts is chronological, most recent first. Why is the order different to what comes out as a result of archive.php?
Example: lets take the category Landscapes which has the following ‘posts’ in this order:
- Stumpy Mountain
- Red Rocks
- In the middle of nowhere
If you click on the first ‘post’, Stumpy Mountain, you will notice previous and next links at the top. Flick through these links, you will notice the order is now reversed.
- In the middle of nowhere
- Red Rocks
- Stumpy Mountain
Loop snippet for the archive.php (category listing template)
<? while (have_posts()) : the_post(); ?> <li> <a href="<? the_permalink() ?>"> <img src="https://www.viewfindergallery.com/_img/<? print get_post_meta($post->ID, 'imgId', true); ?>_.jpg" /> <span class="title"><? the_title(); ?></span> </a> </li> <? endwhile; ?>
Previous and next links on single.php inside the loop:
`<div class=”postRoll”>
<span class=”left”><? previous_post_link(‘« %link’,’%title’,TRUE) ?></span>
<span class=”right”><? next_post_link(‘%link »’,’%title’,TRUE) ?></span>
<br class=”clear” />
</div>’Does anyone know what is going on?
Now an obvious hack would be to swap previous_post_link and next_post_link around, but I shouldn’t have to do that – it programatically doesnt make any sense.*EDIT*
Titles don’t show up on the single.php template, don’t worry about that, I’m aware of it and its an unrealted issue.
- The topic ‘Reverse order of posts in archives bug?’ is closed to new replies.