Despite the many documents and examples on the Internet, I cannot get this simple function to work properly. I have no idea what I'm doing wrong, but nonetheless, this is not working properly. Can anyone determine what I am missing here?
I want to create a custom label cloud, so I do not use wp_tag_cloud ().
$tags = get_tags( array('orderby' => 'name', 'order' => 'ASC'));
foreach($tags as $tag) {
echo "<li><a href=\""
.get_tag_link($tag->term_id)."\">"
.ucwords($tag->name)
."</a> ($tag->count related page)</li>";
}
This leads to the following conclusion:
- Black Box (3 related page)
- Waste (2 related page)
- Recycling (2 related page)
- Garbage (1 related page)
- Cheese (1 related page)
- Blue Box (1 related page)
- Test (1 related page)
As you can see, they are sorted by COUNT, not by name. I have no idea why. My arguments seem to be in order. thoughts?
source
share