SiriusPhil
asked on
Outputting Just The Category Name Using Exisiting Function
I'm new to PHP (from ColdFusion) and am looking to output JUST the Category within a modified template design. Is there a function I can use to do that? the_category() returns the category name with the built in link to the catgeory. I just need the category name outputted.
If there is no function, can someone help me write one?
500 points to the person who can help me learn a little about PHP and WordPress.
Thanks.
Phil
If there is no function, can someone help me write one?
500 points to the person who can help me learn a little about PHP and WordPress.
Thanks.
Phil
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ps the get_the_catagory(); function is the following
function get_the_category($id = false) {
global $post, $category_cache, $blog_id;
$id = (int) $id;
if ( !$id )
$id = (int) $post->ID;
if ( !isset($category_cache[$bl og_id][$id ]) )
update_post_category_cache ($id);
$categories = $category_cache[$blog_id][ $id];
if ( !empty($categories) )
sort($categories);
else
$categories = array();
return $categories;
}
-Regards,
function get_the_category($id = false) {
global $post, $category_cache, $blog_id;
$id = (int) $id;
if ( !$id )
$id = (int) $post->ID;
if ( !isset($category_cache[$bl
update_post_category_cache
$categories = $category_cache[$blog_id][
if ( !empty($categories) )
sort($categories);
else
$categories = array();
return $categories;
}
-Regards,
ASKER