Hello, I have a word press blog where I want appear in the pages of the post is a clickable link to the main category.
I tried different codes but no official does what I want. That is to make visible and clickable link to the single main category where you put a particular post.
For example, I tried the code: <?php the_category(' '); ?>
But this makes all the categories that includes the post and I want it to be visible only that specific.
A good result was obtained using the following code:
$category = get_the_category();
This brings up only one category, and only one reference. But the name is not clickable. But I want it to be clickable and leading to the reference category.
I hope that I explained, otherwise contact me