Remove base slug from hierarchical custom post type

  • Author
    Posts
  • #2783073

    ddarrylyeo
    Member

    I have a **hierarchical** Custom Post Type called project, registered as follows:

    register_post_type( 'project',
    	array(
    		'public'			=> true,
    		'hierarchical'		=> true,
    	)
    );

    The URLs currently look like this:

    I would like the URLs to look like this:

    How can I most efficiently accomplish this such that other URLs are not interfered with (e.g. pages, blog posts, other custom post types)?

    All the solutions that are currently out there either cause 404s on other pages on the site or do not work correctly with nested URLs.

The topic ‘Remove base slug from hierarchical custom post type’ is closed to new replies.