Tagged: post order
Hi All,
I need to display posts alphabetically. This is normally done in the category.php file.
Where so I need to do it in Enfold?
many thanks,
Peter
Hey TheElear!
Try installing this plugin, https://wordpress.org/plugins/post-types-order/, to easily change the order of your posts.
Regards,
Elliott
Hi Elliot,
The plugin you have mentioned above allows for manual sorting (drag & drop) of posts. Not automatic sorting by name/slug.
I need to alphabetize all posts by slug. The premium version of the plugin does that but it costs extra $.
I added the code below to the archive.php under the <?php get_header() ……….. ?> and it works fine:
<?php
$posts = query_posts($query_string . '&orderby=name&order=asc&posts_per_page=-1');
?>
Can you please let me know if archive.php is the only file I need to modify in order to alphabetize category archive, tag archive, all other archives?
Many thanks for your help,
regards,
Peter
Hey Peter!
Can you please let me know if archive.php is the only file I need to modify in order to alphabetize category archive, tag archive, all other archives?
That’s correct, you only need to edit archive.php to alter those views you mention.
Regards,
Josue
Many thanks Josue,
regards,
Peter
PS. you can now close this thread
Sorry Josue,
It seems this does not work for Tag archives and Search results.
Any ideas which files need to be modified for that?
Is it :
– tag.php
– search.php
thanks,
Peter