I have set up a page with the URL slug "announcements"
I also have a custom post type with the rewrite set to the same name:
'rewrite' => array('slug' => 'announcements'),
This all works fine.
It gets tricky here though. On my announcements page, I have a loop, with a Prev and Next page link after the loop.
So if I try to go to page 2 , it looks for the URL /announcements/page/2/ which is a 404.
My guess is this is conflicting with the URLs for the custom post type.
Is there any workaround to make this functional, or am I stuck with changing either the CPT slug or the page name?
Also, the CPT is set to have no archive, if that makes a difference.
Here are the args for my CPT:
$args = array(
'label' => __( 'Announcements', 'textdomain' ),
'description' => __( 'Announcements Custom Post Type', 'textdomain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 4,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'menu_icon' => 'dashicon-here',
'capability_type' => 'post',
'rewrite' => array('slug' => 'announcements'),
);
Thanks