Listing latest posts
-
How could I list links to latest posts from blog inside a sidebar?
I’ve done this earlier by running following iteration inside sidebar.php. First query all posts and then shout out only five first posts. This works fine until you move your sidebar from right to left. Running query_posts() before the actual Loop screws everything up.
query_posts('orderby=date'); $iteration = 1;
if ( have_posts() ) : while ( have_posts() ) : the_post();
if ( $iteration > 5 ) { break; } else { $iteration++; }
the_permalink(), the_title(); ...
endwhile; else:
_e('Sorry, no posts matched your criteria.');
endif;
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Listing latest posts’ is closed to new replies.