Add custom code at start and end of all posts in a category
I am trying to add some html code at the start and end of all posts but this HTML code need to change depending upon the category of the post.
The HTML code is a button to a quiz page. This quiz pages are created as per categories of wordpress.
So for example, all posts in the banking category need to link out to the quiz on banking. All posts in the marketing category need to link out to the quiz on marketing and so on.
I tried shortcoder plugin and WP quad ads to add my HTML code but stuck at how to different HTML code spending upon the category of post.