How to remove a list from <? Php the_category ()?>
1 answer
I think you want get_the_category()and get_category_link():
<?php
// everything available
foreach((get_the_category()) as $category) {
echo '<span><b>';
echo $category->cat_ID . ' ';
echo $category->cat_name . ' ';
echo $category->category_nicename . ' ';
echo $category->category_description . ' ';
echo $category->category_parent . ' ';
echo $category->category_count . ' ';
echo '</b></span>';
}
?>
<?php
// heres just the name and permalink:
foreach((get_the_category()) as $category) {
echo $category->category_nicename . ' ';
echo get_category_link($category->cat_ID);;
}
?>
+7