How you can retrieve the course title from a publish ID.
May be the following a optimum way, or perhaps is there any simpler method.....
$category = get_the_category($post_id); $cat_name = $category->cat_name;
I am unsure of what you are asking but when you're searching for shorter syntax:
If you are just attempting to print a listing of groups owned by a publish, use...
the_category( $separator = '', $parents='', $post_id = false )
which echoes out links, or
get_the_category_list( $separator = '', $parents='', $post_id = false )
which returns a string with links.
If you would like the publish groups as a range of objects use
get_the_category( $id = false ).
The publish ID is optional: whether it's overlooked the functions assume that you're speaking about
global $post. If you are informed this works, otherwise you will need to pass the publish ID.
Regardless, a publish can fit in with several groups, not merely one, despite the fact that the function names imply otherwise.
Each one of these functions live in