Binders: Tags

Returns the tags assigned to a post_id. If no ID is provided, this will return all the tags that are not empty.

 

<!--ALL TAGS (NOT EMPTY)-->
{{tags assign_to="tags"}}
<aside class="widget widget_tag_cloud">
    <h3 class="sidebar-title">Tags</h3>
    <div class="tagcloud">
    {{foreach $tags.data as $tag}}
    	<a href="{{$tag.permalink}}" class="tag-{{$tag.slug}}" title="{{$tag.name}}">{{$tag.name}}</a>
    {{/foreach}}
    </div>
</aside>

 

 <!--TAGS FOR AN SINGLE POST-->
 {{tags assign_to="tags" post_id="234"}}
<aside class="widget widget_tag_cloud">
    <h3 class="sidebar-title">Tags</h3>
    <div class="tagcloud">
    {{foreach $tags.data as $tag}}
    	<a href="{{$tag.permalink}}" class="tag-{{$tag.slug}}" title="{{$tag.name}}">{{$tag.name}}</a>
    {{/foreach}}
    </div>
</aside>

 

Leave a Reply

Your email address will not be published. Required fields are marked *