Category permalinks don’t work even after flushing

I have created a custom post type (portfolio) and I’m using the built-in Category taxonomy with it. When I view the category archives page, only regular posts are showing under the category, my custom posts aren’t there at all. The options to select categories are there in the Edit Post page (and Quick Edit), they just aren’t showing up on the front end.

I have tried flushing the permalinks by saving under Settings > Permalinks, and I have also tried including flush_rewrite_rules(); in my functions.php. Nothing works?

Here is my custom post type code (note: my custom posts work fine with rewrite rules, it’s just the categories):