Just as @PieterGoosen mentioned, in a deleted comment, the post types should be registered within a init
hook callback.
The after_setup_theme
action is fired before init
, so that hook will not help you.
Try for example hooks fired after init
, like wp_loaded
.
Here’s for example a list of the actions order from my vanilla install.