You’ll want to use query_posts to re-order the loop to ASC (ascending) rather than the default DESC (descending.) Before your Loop, add this line:
<?php query_posts('order=asc'); ?>
and the query_posts function will re-query the loop to order in ascending order. Here’s an example of a modified version of Kubrick’s index:
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : ?>
<?php query_posts('order=asc');
while (have_posts()) : the_post(); ?>
I think I don’t understand “loop” correctly. I tried to build in your piece of code and then I get a parse error on the last line. Can’t understand why. his is my a litte bit modified index. Where should I build in your code? Thanks for a little bit help. hama
<body>
<div id=”rap”>
<?php get_header(); ?>
<div id=”main”>
<div id=”content”>
<div class=”post”>
<div class=”post-info”><h2 class=”post-title”>Willkommen</h2></div>
<div class=”post-content”>
<img src=”index/index.jpg” alt=”Sybi” class=”teaser” />
Text comes soon.
<div class=”post-footer”> </div>
</div>
</div>
</div>
<div id=”sidebar”>
<h2><label for=”s”><?php _e(‘Search:’); ?></label></h2>
-
<form id=”searchform” method=”get” action=”<?php echo $_SERVER[‘PHP_SELF’]; ?>”>
<div style=”text-align:center”>
<input type=”text” name=”s” id=”s” size=”15″ />
<input type=”submit” name=”submit” value=”<?php _e(‘Search’); ?>” />
</div>
</form>
<h2><?php _e(‘Categories:’); ?></h2>
<?php wp_list_cats(‘optioncount=1’); ?>
</div>
<?php get_footer(); ?>
</div>
</div>
</body>
I solved the problem. My startpage is static so I had to build in
<?php query_posts(‘order=asc’);
into category.php. It works. 🙂
Have a good time
hama
It didn’t work! My solution to build in the code into category.php is wrong!
In one category it worked, in another one not and in monthly view it didn’t work.
Maybe someone can help me again and show me how to include ” ascending ” in every category and in monthly view. I modified index.php because I want a static frontpage.
Thanks and have a nice evening!
hama