Have Wordpress in the root of the site. Want the URL structure for pages to be example.com/{page-slug} and for posts to be example.com/academy/{post-slug}. I have my permalinks set to custom with /academy/%postname% as the structure.
This works great. However, I have a custom post type called definitions. I would like the definitions URL structure to be example.com/glossary/{definition-slug}. Currently with the above set up I am getting a URL of example.com/academy/definition/{definition-slug}
Is there a way to exclude custom post types from the post permalink settings?
Here is my custom post definition:
function create_posttypes() {
$labels1 = array(
'name' => __( 'Definitions' ),
'singular_name' => __( 'Definition' ),
'all_items' => __( 'All Definitions' ),
'view_item' => __( 'View Definition' ),
'add_new_item' => __( 'Add New Definition' ),
'edit_item' => __( 'Edit Definition' ),
'update_item' => __( 'Update Definition' ),
'search_items' => __( 'Search Definitions' ),
'not_found' => __( 'Not Found' ),
'not_found_in_trash' => __( 'Not Found in Trash' ),
);
$args1 = array(
'label' => 'Definitions',
'description' => 'Definitions received',
'labels' => $labels1,
'public' => true,
'has_archive' => true,
'rewrite' => array('slug', 'definitions'),
'hierarchical' => false,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
'supports' => array('title','thumbnail', 'revisions', 'page-attributes')
);
register_post_type( 'definitions', $args1 );
}
rewrite
args try this :["slug" => "glossary", "with_front" => FALSE]