Sort tags by most popular

Hey all!

I’m trying to build my tag cloud to sort tags by most popular or most used on my homepage via tag cloud.

Here’s what I’m currently doing:

{{t "Topics" }}</h4>
    {{#get "tags" limit="30"}}
        {{!-- {{tags separator=""}} --}}
        {{#foreach tags visibility="public"}}
            <a href="{{url}}" class="ctag ctag-{{slug}}" data-id="ctag-{{slug}}"><svg><use xlink:href="#tag-decoration"></use></svg>{{name}}</a>
        {{/foreach}}
    {{/get}}

Reading the documentation, I’m not seeing a way that the tags show up in the most popular order.

Thanks!

Erin

It’s possible to get the most used tags, using count.posts in combination with ordering, like this:

{{#get "tags" limit="30" include="count.posts" order="count.posts desc"}}
2 Likes