Ashley Cameron Design

Ashley Cameron Design

List all SubCategories

SnippetsWordPress

About a 1 minute read

"This is the real secret of life — to be completely engaged with what you are doing in the here and now. And instead of calling it work, realize it is play."

Alan Watts


1
2
3
4
5
6
7
8
9
10
11
$echo = '<ul>' . "n";
$childcats = get_categories('child_of=' . $cat . '&hide_empty=1');
foreach ($childcats as $childcat) {
    if (1 == $childcat->category_parent) {
        $echo .= "t" . '<li><a href="' . get_category_link($childcat->cat_ID).'" title="' . $childcat->category_description . '">';
        $echo .= $childcat->cat_name . '</a>';
        $echo .= '</li>' . "n";
    }
}
$echo .= '</ul>' . "n";
echo $echo;