permalink structure for custom post types
-
I currently have my permalink structure sezt to the following:
/blog/%year%/%monthnum%/%postname%/I have setup a few custom post types one of which is ‘resource’ that has custom taxonomies like ‘e-books’ and ‘videos’ but when I go to the category archive pages for the custom taxonomy the permalink looks something link this: https://www.mysite.com/blog/media-type/e-books/
Is there a way to remove ‘blog’ from the permalink?
here’s my code for the custom post type below as well:
$labels = array( 'name' => _x('Resources', 'post type general name'), 'singular_name' => _x('Resource', 'post type singular name'), 'add_new' => _x('Add New', 'resource post'), 'add_new_item' => __('Add New Resource'), 'edit_item' => __('Edit Resource'), 'new_item' => __('New Resource'), 'view_item' => __('View Resource'), 'search_items' => __('Search Resources'), 'not_found' => __('Nothing found'), 'not_found_in_trash' => __('Nothing found in Trash'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => null, 'show_in_nav_menus' => true, 'menu_position' => 30, 'menu_icon' => get_stylesheet_directory_uri() . '/images/ico_resources.png', 'rewrite' => array( 'slug' => '/resources', 'with_front' => false ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ) ); register_post_type( 'resources' , $args ); register_taxonomy( 'media-types', 'resources', array( 'hierarchical' => true, 'label' => 'Media Types', 'query_var' => true, 'rewrite' => true ) ); flush_rewrite_rules( false );
- The topic ‘permalink structure for custom post types’ is closed to new replies.