It is not uncommon for a WordPress blog to display a list of all posts in an alphabetical order. I was using
<?php wp_get_archives('type=postbypost');?> to display all posts by post title but I couldn't find a way to sort the post titles in an alphabetical order. After looking at the source code (general-templates.php), I noticed that WordPress already has a built-in functionality that does that. All you need to do is replace
alpha and it will displays all posts in an alphabetical order of the post title. Not sure why it isn't mentioned in wp get archives Template Tags page.
5 thoughts on “A list of all posts in an alphabetical order”
Wow, I’ve been trying to figure out how to do this within my Sitemap. I had no idea it was so simple! This was very helpful. Thanks!
Really helpful, thanks man!! was looking all over the net for this one.
I don’t know why I couldn’t find this on the WordPress site. I just spent a ridiculous amount of time, and you rescued me from a meltdown.
Is social media going to kill SEO?
I was using azindex plugin to index my posts in alphabetical order and create a TOC like page, bu suddenly it stopped working, can anyone help me out with anyother method which i can understand, i know nothing about coding
Comments are closed.