I'm trying to alter what my
single.php template outputs depending on the category of the post. I add this code in the loop:
<?php $allcats = get_the_category(); $postcat = $allcats->cat_name; ?>
$postcat to return the name of the current post's category (posts only have one category). My site has a total of 5 categories.
I'm finding that the value of $postcat is always 'report', regardless of whether this is the category of the post. 'report' was the last category I added to the site.
Am I misunderstanding or misusing