Make archive posts ascending revisited
-
A year ago I was kindly given the solution:
<?php // Runs before the posts are fetched add_filter( 'pre_get_posts' , 'my_change_order' ); // Function accepting current query function my_change_order( $query ) { // Check if the query is for an archive if($query->is_archive) // Query was for archive, then set order $query->set( 'order' , 'asc' ); // Return the query (else there's no more query, oops!) return $query; } ?>
Since then I have tried to improve my blog archive page and clearly have messed something up. If I put in ‘order’ , ‘asc’ in myfunctions file , it reverses the order of my current blog as well as the archives.
I use the chunk theme and have created a chunk-child folder. Then…. without really knowing what I was doing!…. I have created a blog-archive page using Custom Archives, whichrefers to a file page_archives_custom.php. I have also created two files fullwidthtemplate.php and contentfullwidth.php, which I think work with this custom archive page (don’t ask me how!). And finally a functions file, in which I put the code kindy provided by Kathryn.
As you can see, I’m out of my depth, and would really appreciate it if someone could help me.
(I have a secondary plea for help,which I imagine I should post separately – to get next and previous links to work!)
- The topic ‘Make archive posts ascending revisited’ is closed to new replies.