I am really inexperienced with wordpress but I modified the cutline themes archive page to show my posts by year, month, and post title in ascending order. When someone clicks on say the Oct 25 link the navigation will show the next post as Oct 29, and the previous post as Oct 24 which is correct. But if someone clicks on the month or year tab, the posts are in descending order. How do I get those to display in ascending order also?
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<ul >
<?php
/**/
$years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date ASC");
foreach($years as $year) :
?>
<h4><li><a href="<?php echo get_year_link($year); ?> "><?php echo $year; ?></a>
<ul>
<?php $months = $wpdb->get_col("SELECT DISTINCT MONTH(post_date) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND YEAR(post_date) = '".$year."' ORDER BY post_date ASC");
foreach($months as $month) :
?>
<h4><li><a href="<?php echo get_month_link($year, $month); ?>"><?php echo date( 'F', mktime(0, 0, 0, $month) );?></a>
<ul>
<?php $theids = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND MONTH(post_date)= '".$month."' AND YEAR(post_date) = '".$year."' ORDER BY post_date ASC");
foreach ($theids as $theid):
?>
<h4 style= font-style:italic;><li><a href="http://www.kittywake.us/?p=<?php echo $theid->ID; ?>"><?php echo $theid->post_title; ?></a></li></h4>
<?php
endforeach; ?>
</ul>
</li></h4>
<?php endforeach;?>
</ul>
</li></h4>
<?php endforeach; ?>
</ul>
</div>
Thank you for any help. I did try Shanes suggestion and modified the general-template.php file but it didn't change anything.
Sue