I have a Custom Post Type (CPT) called "Careers" with "careers" as slug.
I created my Careers listing page with Elementor (the page slug is also "careers"), dropped the Posts widget and used the Query settings to select my Careers CPT. Then I used Elementor again to create a Single post theme for my single careers posts. The single posts are working okay but now when I click back to my Careers listing page, I get the archive page that doesn't look anything like the page I created with Elementor (I see the page is now using archive.php with Reveal template plugin). I tried to force the template by selecting a custom page template, but that didn't help. I also tried resetting the Permalinks, that didn't help either.
When I try to open my Careers page in Elementor, I get the "Preview could not be loaded Error". When I change the page URL from "careers" to "career" or "open-positions" then the error goes away, I can open the page with Elementor now (with a new slug).
Is this a correct assumption that the CPT slug cannot be the same as the page slug? Is there a better way to accomplish this (preferably with the same slug for both the page and the CPT)? Or even with the help of Elementor pro?
This is my CPT code:
function create_careers_posttype() {
register_post_type( 'careers',
array(
'labels' => array(
'name' => __('Careers'),
'singular_name' => __('Career')
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'careers'),
'show_in_rest' => true,
'supports' => array('title', 'page-attributes'),
)
);
}
add_action( 'init', 'create_careers_posttype' );