• I am using my site to make a taxonomy of incidents. I would like to insert the category title that the post is categorize as into the post. Is this possible?

    Example:

    Name of event: example name
    Type of Incident: [Category Title 1]
    Number of Injuries: [Category Title 2]
    Location of Event: [Category Title 3]

    Essentially there will be a pretty complex category hierarchy and [Category Title 1] will display whichever subcategory that I have checked for this post (could be categories 3,5,6,7) but I only want it to display this category. This is easy enough (to exclude/include categories), but what I need is to figure out how to actually call the category titles into the post text.

    ALSO – why are my posts only displaying one category, instead of all the categories for which they have been selected? This is the display code:

    <a href="<?php $category = get_the_category(); echo get_category_link($category[0]->cat_ID); ?>"><?php echo $category[0]->cat_name; ?></a>

  • The topic ‘Display certain category title (not posts) in posts’ is closed to new replies.