Add Custom Post Type to Category Archive & archive.php

Wonder why your WordPress theme is not recognizing your custom post types on category archive pages? Archives.php displays ‘posts’ data by default, but you can add the following tweak to your functions.php file to alter the archives.php to display all or a selection of your custom posts.

Make sure if you want to add more than one custom post type, to separate them with commas.