Support » Fixing WordPress » Use get_cat_name for Links/Blogroll Categories

  • jpomfret

    (@jpomfret)


    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi

    (@esmi)

    Forum Moderator

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

    jpomfret

    (@jpomfret)

    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

    esmi

    (@esmi)

    Forum Moderator

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

    jpomfret

    (@jpomfret)

    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

    esmi

    (@esmi)

    Forum Moderator

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Use get_cat_name for Links/Blogroll Categories’ is closed to new replies.