$args = array(
'orderby' => 'name', // Can be 'id', 'name', 'date', etc...
'order' => ASC // Can be ASC or DESC
);
query_posts($args);
If you are already parsing $args to query_posts() then ensure that you add the above options to those $args, as opposed to redeclaring $args and overwriting them.
Thread Starter
BennoH
(@bennoh)
Thanks for the help duck_boy, unfortunately I do not understand this. I am a total novice and know next to nothing about code. Could you please elaborate in layman’s terms?
From your root folder navigate to ‘/wp-content/themes/{whatever theme}/’ and find a file called ‘index.php’. This is where WP gets the posts that it displays.
Do a search and look for ‘query_posts’ – if you do not find it, copy the code above and place it just before The Loop, which will be identifed by one of the following –
if(have_posts) : while(have_posts) : the_post() ....
template_part('loop', 'index');
Make sure you use a proper eidtor (I use Total Edit), not MS Word, as that will mess the file up. and make sure that the code is inside PHP tags (<?php {Your code} ?>).
Thread Starter
BennoH
(@bennoh)
Brilliant. That is exactly what I was after… Many thanks!
No probelem, hope it helps.