I have problem displaying my wp_list_categories
with Style. I am already using args, etc but that does not seem to help with the problem.
I want to display same sub-categories for single article.
Here my code :
<?php
if (is_home()) {
wp_list_categories('orderby=id&title_li=none&depth=1');
} else {
$category = get_the_category();
$cat_term_id = $category[0]->term_id;
$cat_category_parent = $category[0]->category_parent;
$listcat = wp_list_categories('echo=0&child_of='.$cat_category_parent.'&title_li=');
$listcat = str_replace("cat-item-".$cat_term_id, "cat-item-".$cat_term_id." current-cat", $listcat);
if ( in_category( $cat_term_id ) || post_is_in_descendant_category( $cat_term_id )) {
echo $listcat;
}
}
?>
</ul>
and here is the result :
http://i.stack.imgur.com/buYyl.jpg
I want the result will be like this :
I think this might work for you, but I’m not exactly sure which theme file you’re referencing above.
Then you could use this CSS to style the category list appropriately: