Is it possible to make this:
<li><a href="categories-url">categories name</a> (25)</li>
into this:
<li><a href="categories-url">categories name (25)</a></li>
Is it possible to make this:
<li><a href="categories-url">categories name</a> (25)</li>
into this:
<li><a href="categories-url">categories name (25)</a></li>
You could try something like this:
<ul>
<?php
$args=array(
'orderby' => 'name',
'order' => 'ASC'
);
$categories=get_categories($args);
foreach($categories as $category) {
echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name. ' ('. $category->count . ')</a> </li> ';
}
?>
</ul>Works beautifully, thank you for the code. Any Idea how to list them in this format with parent category hierarchy? I'm assuming whatever I need to add to this for parent/child will be somewhere in the docs.
Again, thank you, your help was very much appreciated.
This topic has been closed to new replies.