Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter Anonymous

    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)

    Thread Starter Anonymous

    i know it sounds like a simple thing, but afaik this isn’t possible without a hack. try googling for a category images plugin.

    Thread Starter Anonymous

    oh and get_the_category is not in the Wiki list of template tags. i assume it is 1.3 only.

    Thread Starter Anonymous

    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
    Regards

    Do you know by the way if wp_list_cats accepts arguments for diplaying
    Category name (the qty of post in the category)

    ?

    Thread Starter Anonymous

    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.

    Thread Starter Anonymous

    well I would, but I don’t know enough php to decode all the top-sekrit functions.

    Thread Starter Anonymous

    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;
    } ?>

    Thread Starter Anonymous

    why isn’t there an easier way?

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘catagory’ is closed to new replies.