I’ve been googling around for a while and going through the WP codex to try to find a way to do this. I can use ‘order_by=tag’ within query_posts but it doesn’t order the posts alphabetically by tag name. I’ve tried combinations using ‘order=ASC’ and ‘order=DESC’ but nothing seems to work. Does anyone know if there’s even support for this in WordPress using query_posts? Would I have to try a different approach and maybe use an array?
Hey clokey thanks for the reply again, really appreciate your input. The filtering blocks worked great and I was able to categorize the posts into tabs by their tag-name. While the filtering blocks allow me to filter certain posts it doesn’t allow me to display all of the posts in a specific order (in this case alphabetically). I have 5 options, the first is ‘All’ the second is ‘Type’ and the last 3 are categories. The ‘All’ and the categories work fine using the filtering blocks, but the ‘Type’ option needs to list all of the posts in order by tag-name alphabetically.
I understand what you’re saying about there being multiple tags and not knowing which one to use to order by, I was hoping it would just take the first one and use that, but unfortunately not. I thought that order_by=tag was ordering the posts by tag ID, but after further investigation it was just coincidence!
I’m by no means an expert in PHP but do you know whether it’s actually possible to achieve this?
I think you’ll have to move back to the drawing board on this one…
Ordering by tag’s could be done using:
< ?php $tag = wp_tag_cloud('format=array' );?>
Which would create an array of all tags used. Then loop through each tag and run a loop of posts containing that tag. It would be messy… and any post with multiple tags will appear in the list for each tag it contains.
You might have to resort to an AJAX call to load them…