WordPress.org

Ready to get started?Download WordPress

Forums

Use get_cat_name for Links/Blogroll Categories (6 posts)

  1. jpomfret
    Member
    Posted 3 years ago #

    Hi guys,

    Quick question I am trying to display the category name from the category ID. I have found a snippet using get_cat_name and an example on how this works in the codex but I can't get it to work for links/blogroll categories. Is there something I am missing or is there a different function for these categories?

    echo get_cat_name($category_id);

    Thanks for you help in advanced!

    Jess

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    get_cat_name is for post categories - not link categories.
    http://codex.wordpress.org/Function_Reference/get_bookmarks

  3. jpomfret
    Member
    Posted 3 years ago #

    Thanks I presumed their was a different function I can't get the get_bookmarks to work either though? Maybe I didn't explain very well, I need to show the category name above a list of the links in that category. I have the list working well just can't get the title to show?

    Any ideas?

    Thanks again

    Jess

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Assuming this is a page of links and not a post category, just use wp_list_bookmarks

  5. jpomfret
    Member
    Posted 3 years ago #

    Do you have a code example, when I try it doesn't seem to return the title, just a list of the link titles for that category.

    Thanks

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    <?php wp_list_bookmarks('title_li=&category_before=&category_after='); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic