I think your problem lies with the use of get_object_taxonomies( $object, $output )
. If you have a look at the codex, the $object
parameter should be
Name of the post type, or a post object (row from posts)
As your code currently stands, you are using the taxonomy name, not post type. If you print $customPostTaxonomies
with
print_r( $customPostTaxonomies);
you get Array()
, that is why you get no output.
When you change get_object_taxonomies('jobfelder');
to get_object_taxonomies('jobboerse');
, your code works and output the names of the taxonomies which is related to your custom post type ‘jobboerse’
EDIT
Thanks to @cfx
Better be safe than sorry when registering custom taxonomies for custom post types. Use
register_taxonomy_for_object_type()
right after the function (emphasis added) to interconnect them.