Forums

catagory (15 posts)

  1. Anonymous
    Unregistered
    Posted 7 years ago #

    catagory

  2. Anonymous
    Unregistered
    Posted 7 years ago #

    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)

  3. Beel
    Member
    Posted 7 years ago #

    get_the_category (note correct spelling)

  4. Anonymous
    Unregistered
    Posted 7 years ago #

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

  5. Anonymous
    Unregistered
    Posted 7 years ago #

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

  6. Anonymous
    Unregistered
    Posted 7 years ago #

    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)

  7. Cypher
    Member
    Posted 7 years ago #

    get_the_category() is defined in /wp-includes/template-functions-category.php
    Regards

  8. midori
    Member
    Posted 7 years ago #

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

  9. Anonymous
    Unregistered
    Posted 7 years ago #

    what's the point in having a template tags page that only covers some of the functions? seems kind of wacky to me.

  10. Beel
    Member
    Posted 7 years ago #

    feel free to add to it, won't take much more time than it takes to complain.

  11. Anonymous
    Unregistered
    Posted 7 years ago #

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

  12. Anonymous
    Unregistered
    Posted 7 years ago #

    thanks for the pointer to the correct file to edit :)

  13. Beel
    Member
    Posted 7 years ago #

    http://wordpress.org/support/3/7389#post-44222
    <?php
    $categories = get_the_category();
    echo $categories[0]->cat_name;
    echo $categories[1]->cat_name;
    etc.
    ?>

  14. Beel
    Member
    Posted 7 years ago #

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

  15. Anonymous
    Unregistered
    Posted 7 years ago #

    why isn't there an easier way?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.