catagory
-
on the default template it uses “the_catagory()” and it makes a link . i just want the name of the catagory without the link, how do i get that? ( i want to use it to display an aimage)
get_the_category (note correct spelling)
i know it sounds like a simple thing, but afaik this isn’t possible without a hack. try googling for a category images plugin.
oh and get_the_category is not in the Wiki list of template tags. i assume it is 1.3 only.
oh my! thats really daft! does anyone know where i can find the functoin so that i can hack it?
thanks for your help (and the spell correction heh)get_the_category() is defined in /wp-includes/template-functions-category.php
RegardsDo you know by the way if wp_list_cats accepts arguments for diplaying
Category name (the qty of post in the category)
…
?what’s the point in having a template tags page that only covers some of the functions? seems kind of wacky to me.
feel free to add to it, won’t take much more time than it takes to complain.
well I would, but I don’t know enough php to decode all the top-sekrit functions.
thanks for the pointer to the correct file to edit π
http://wordpress.org/support/3/7389#post-44222
<?php
$categories = get_the_category();
echo $categories[0]->cat_name;
echo $categories[1]->cat_name;
etc.
?>So to get all your category names echoed, you could use something like:
<?php
$categories = get_the_category();
foreach ($categories as $category) {
echo $category->cat_name;
} ?>why isn’t there an easier way?
The topic ‘catagory’ is closed to new replies.