SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WordPress: Category ID to name?

    I need to convert a WordPress cateogory ID to it's name for echo'ing on screen and get the URL for that category.

    Users will have the ability to enter a category ID into their WP admin panel, then the theme will grab that ID, post the latest posts for that category and add a title and link to that category. I can do everything but work out the name and URL.

    Any ideas on how to do this?

    I had a good hunt through the WordPress codex but haven't had any luck figuring this out.

  2. #2
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found a solution eventually ... http://wordpress.org/support/topic/152852

    Get category name from ID:
    Code php:
    get_cat_name($catid)

    Get category URL from ID:
    Code php:
    get_category_link($catid)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •