Hi Sybre,
I finally found time to look at the issue again. I flushed the permalinks and the cleared the site cache. But with no effect.
Please note that the custom post type doesnt have any taxonomies added. The default taxonomies are not activated.
I am using CPT UI to register the custom post type. Here is the code:
function cptui_register_my_cpts_master() {
/**
* Post Type: Master.
*/
$labels = [
"name" => __( "Master", "generatepress" ),
"singular_name" => __( "Master", "generatepress" ),
];
$args = [
"label" => __( "Master", "generatepress" ),
"labels" => $labels,
"description" => "Custom Post Type in dem [...]. ",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"has_archive" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"can_export" => false,
"rewrite" => [ "slug" => "master", "with_front" => true ],
"query_var" => true,
"menu_icon" => "dashicons-welcome-learn-more",
"supports" => [ "title", "editor", "thumbnail", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "author", "page-attributes", "post-formats" ],
"taxonomies" => [ "category", "post_tag" ],
"show_in_graphql" => false,
];
register_post_type( "master", $args );
}
add_action( 'init', 'cptui_register_my_cpts_master' );
To rule out that CPT UI is causing the issue I registered a basic CPT in PHP:
function create_posttype() {
register_post_type( 'movies',
// CPT Options
array(
'labels' => array(
'name' => __( 'Movies' ),
'singular_name' => __( 'Movie' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'movies'),
'show_in_rest' => true,
)
);
}
add_action( 'init', 'create_posttype' );
The staging site has a lot of customization. So I setup a local testing site (fresh 5.9.2 install with 2022 theme) and did the same as above. I registered a post type with CPT UI and one with the code above. I checked the source code and in both cases the single custom post type did not include breadcrumbs or any other schema markup.
I am not sure where to check next?
Thank you very much for your help!
Kind regards
Yannick
-
This reply was modified 4 years, 2 months ago by
yann1ck.
-
This reply was modified 4 years, 2 months ago by
yann1ck. Reason: Code still messed up