WordPress.org

Ready to get started?Download WordPress

Forums

Category descriptions? (9 posts)

  1. Jason
    Member
    Posted 10 years ago #

    Have you tried category_description()?

  2. Bonnie
    Member
    Posted 10 years ago #

    Yes, I've tried that one - I didn't get an error on the main category pages like with other tags, it just didn't display anything.

  3. Bonnie
    Member
    Posted 10 years ago #

    Does anyone else have any ideas? Or is this function not yet supported...?

  4. Anonymous
    Unregistered
    Posted 10 years ago #

    Ah I would like to know this too.
    & To display on a archive page I made....
    categoryname: categorydescription
    etc.

  5. Anonymous
    Unregistered
    Posted 10 years ago #

    me, too....

  6. mikelu
    Member
    Posted 10 years ago #

    Did you try using category_description() with specified category_id? like this: category_description($some_cat_id)

  7. Neel
    Member
    Posted 10 years ago #

    I'm also trying to get this working - I've noticed that wp_list_cats() generates the list of categories and sticks each category description into the title of each link.
    So, somewhere in the wp_list_cats() function in wp-includes/template-functions-category.php there's a bit of code that we can surely adapt to be a simple print_cat_des() function, right?
    [ I have almost no idea what PHP's up to, so why it's not possible to swop a few words from this hack is beyond me... ]
    Line 186 in template-functions-category.php defines category_description($category = 0), but that seems to be doing naff all - how about down on line 343 where it uses
    $link .= 'title="' . htmlspecialchars($category->category_description) . '"';
    to put in the title for the category link? But I have no idea how to mung this into a workable function. Little help?

  8. carthik
    Member
    Posted 10 years ago #

    Try

    <?php category_description('1'); ?>

    to get the desc for the category with id = 1
    It should work.

  9. kappaluppa
    Member
    Posted 9 years ago #

    this works, but does not display the title before the description

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.