Custom post type getting wrong categories and tags

The problem lies in how you are displaying the videos on the side. Somewhere you are looping through some posts to produce that list. Notice the last post on that list in the screenshot is an interview with once upon a time – and thats what the categories and tags are related to.

Why is this happening?

WordPress stores a global variable $post which is suppose to be the post (object) being viewed, and it’s this that the WordPress functions use to display stuff like categories and tags etc related to that post.

In this case, the global $post has been changed when displaying the sidebar lists. Probably because you’ve used WP_Query or (worse) query_posts (see this warning) or you’ve used (recommended) get_posts but as you’ve gone through the loop, you’ve declared the current post to be global (either by declaring global $post or using the_post() method).

So as you go through the loop, you are over-riding the global $post variable, until you get to the last one – and then it stays on that post. This is why you are seeing that post’s categories and tags.

How to fix it…

It depends on how you’ve made the loop. You can use wp_reset_postdata if you’ve used the WP_Query object. Or, if you’ve used the get_posts, don’t declare the post as global and instead pass its IDs to the functions. Alternatively, you can store the original global $post (i.e. the main post) in a temp variable and reset it after the loop. See an example of that here.

Hope that helps!