• joshua4

    (@joshua4)


    in php I have a category ID; 43

    How do I get the title of category 43? I don’t want a list, I don’t want it to format or output, I don’t want any help from wordpress. Simple function, pass id, get title or array of cat info. How?

Viewing 2 replies - 1 through 2 (of 2 total)
  • stvwlf

    (@stvwlf)

    This from WP source code

    function get_cat_name( $cat_id ) {
         $cat_id = (int) $cat_id;
         $category = &get_category( $cat_id );
         return $category->name;
     }

    not sure whether “name” is the cat title or cat slug

    iridiax

    (@iridiax)

    I don’t want any help from wordpress.

    Huh?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘SIMPLE: get a category title outside the loop’ is closed to new replies.