WordPress categories with descriptions

by admin on september 12, 2011

Some WordPress-themes has the description of the category below the category name.
This is not standard in WordPress.
So this is how you can do it

$args=array(
);
$categories=get_categories($args);
foreach($categories as $category) {
echo '<li><strong><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a></strong>';
echo '<br />'. $category->description . '</li>';
}
#wpyagnav{
height: 61px;
background: #d0d0d0;
margin-left: auto;
margin-right: auto;
width: 980px;
}

ul.wpyagcat{
padding-top: 11px;
}

ul.wpyagcat li{
display: inline;
float: left;
position: relative;
margin-left: 18px;
text-align: center;
}

Leave your comment

You must be logged in to post a comment.