Custom post type’s permalink adds the name of the post type before the post name

So I’ve create a custom post type which seem to work.

however the permalinks of the create posts has the name of the custom post type in-front of the post name.

Read More

I am getting addresses like:
http://demoforhim2.e-ddl.com/movie_reviews/secondone/

and trying to change that to : http://demoforhim2.e-ddl.com/secondone/

From reading some articles e.g http://wordpress.org/support/topic/custom-post-type-permalink-rewrite this is possible

I’ve tried using rewrite with empty slug but it did not work.

Here is my custom post type

add_action( 'init', 'create_movie_review' );
function create_movie_review() {
register_post_type( 'movie_reviews',
    array(
        'labels' => array(
            'name' => 'Movie Reviews',
            'singular_name' => 'Movie Review',
            'add_new' => 'Add New',
            'add_new_item' => 'Add New Movie Review',
            'edit' => 'Edit',
            'edit_item' => 'Edit Movie Review',
            'new_item' => 'New Movie Review',
            'view' => 'View',
            'view_item' => 'View Movie Review',
            'search_items' => 'Search Movie Reviews',
            'not_found' => 'No Movie Reviews found',
            'not_found_in_trash' => 'No Movie Reviews found in Trash',
            'parent' => 'Parent Movie Review'
        ),
        'public' => true,
        'menu_position' => 15,
        'supports' => array( 'title', 'editor', 'comments', 'thumbnail' ),
        'taxonomies' => array( '' ),
        'menu_icon' => plugins_url( 'images/16x16.png', __FILE__ ),
        'has_archive' => true,
        'rewrite' => array('slug' => '', 'with_front' => FALSE) /*doesnt seem to work*/
    )
);
}

for some reason the above doesn’t work properly.

Related posts

Leave a Reply