I want to output the different categories assigned to a post. Let'say for example that a post has three categories:
- Downloads
- Games
- Video
Previously I have used <?php echo get_the_category_list(); ?>
But this wraps the <a>
in a <span>
instead of wrapping the <span>
in a* <a>
...
I want to list the categories like this:
<a href="the_URL_of_the_category_downloads">
<span class="the_name_of_the_category_downloads">the_name_of_the_category_downloads</span>
</a>
<a href="the_URL_of_the_category_games">
<span class="the_name_of_the_category_downloads">the_name_of_the_category_games</span>
</a>
<a href="the_URL_of_the_category_videos">
<span class="the_name_of_the_category_downloads">the_name_of_the_category_videos</span>
</a>
I am not sure how I can get this to work with php as I have very limited knowledge of PHP in general.