Get a list of post categories

if you need to get a list of blog post categories you can simply use this code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{category show="list" assign_to="categories"}
<div class="box">
    <div class="sidebar_header">
        <h4>Categories</h4>
    </div>
 
    <ul class="sidebar_menu">
        <ul>
        {foreach $categories.data as $cat}
            <li class="cat-item cat-item-{$cat.cat_ID} cat-{$cat.slug} {if $cat.slug == $query.category_name}active{/if}">
                <a href="{$cat.permalink}" title="{$cat.description}">{$cat.name}</a> ({$cat.count})
            </li>
        {/foreach}
        </ul>
    </ul>
</div>
{category show="list" assign_to="categories"}
<div class="box">
    <div class="sidebar_header">
        <h4>Categories</h4>
    </div>

    <ul class="sidebar_menu">
        <ul>
        {foreach $categories.data as $cat}
            <li class="cat-item cat-item-{$cat.cat_ID} cat-{$cat.slug} {if $cat.slug == $query.category_name}active{/if}">
                <a href="{$cat.permalink}" title="{$cat.description}">{$cat.name}</a> ({$cat.count})
            </li>
        {/foreach}
        </ul>
    </ul>
</div>