You don’t explicitly set a slug, so it uses the post type key you registered it with. To set it to gallery, set slug
of rewrite
parameter:
$args = array(
'rewrite' => array( 'slug' => 'gallery' ),
// the rest of your args...
);
register_post_type( 'vmgallery', $args );
See the Codex page for register_post_type
for a full list of parameters.
Related Posts:
- Display all posts in a custom post type, grouped by a custom taxonomy
- Programmatically publish a post (custom post type) with custom fields
- Get list of registered custom post types
- Echo all meta keys of a custom-post TYPE
- Ordering Posts List By Taxonomy Terms?
- Change slug of registered custom post type in child theme
- Issues when rewrite rules collide?
- Custom post type permalink changing itself every other change
- How to sort CPT by custom meta value (date), and return posts month by month
- WordPress Custom Shortcode Conflicting with Media Library
- Creating a gallery custom post type?
- Search results ordered by custom post types are not grouped
- Featured image metabox not showing up
- Limit Authors to their Own Posts on front-end excluding admins
- Custom post type archive with dynamic taxonomy filtering – is it possible
- Multiple Archive Pages for Custom Post Types AND Taxonomies
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Add information above a custom post type listing of all posts page
- Adding menu_order to CPT admin page
- How do I sort a custom post type admin column using two meta keys?
- Making a Custom Post type only visible to non-users via a specific link
- reference the current category being used in the category.php page
- Search doesn’t find tags or categories in custom post types
- Add custom post type archives to search results?
- CPT Meta Searching
- Taxonomy.php Not Showing Posts
- Rewrite URL for only archive page (custom post type)
- Plugin translation not working apart from name and description
- Archive template for custom post type only lists first 10
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Add category attribute to custom shortcode
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- How to display all posts from standard posts to custom post types in a loop with pagination?
- Custom rewrite rule for hierarchical custom post type
- Retrieve value of a category’s custom field
- Page template with different page and post content
- Custom Post Type with archive page but no detail page
- Custom Post Type with image gallery
- How to integrate video slide using custom post types?
- Custom post type url with category
- Display featured image from one CPT within another CPT query
- Show titles, date of all posts on single category page
- Remove slug in URL custom post type
- How to restrict author to only access one custom post type ?
- Not sure if I should create multiple custom post type [closed]
- How to get a custom field value of a custom post?
- Set Custom Post Type in Widget Settings for use in Widget
- Add CPT values to Database
- Multiple single templates?
- Template files for Custom Post Type and Taxonomy
- Ascending Order is not Working in Custom Post Type Listining
- How can i display movies in profile page, added by an user?
- how to set a WP Plugin’s url
- WordPress menu with custom taxonomy
- attach CPT data to a taxonomy
- Values from meta-box not on $_POST
- custom endpoints on Custom Post Type return 404 page not found
- ajax response not recieving
- Creating a non-hierarchical Taxonomy that behaves like categories
- Custom posttype content metabox
- Custom Post type content within a slider
- Categories won’t appear on custom post type
- Custom Post Type with Configurable Sidebar via ACF
- Add Custom Values to Permalinks Through Custom Fields and Posts
- “Custom Field” to Excerpt field” for pages? [closed]
- Get_the_term_list inexplicably adds values in foreach
- Single parent post lists child posts with pagination
- Custom post type items open in archives?
- Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?
- Custom post category name showing empty
- How can I write a function that would update any missing specific post metadata?
- Not saving custom taxonomy while using ajax
- Show a custom post title in another custom post type in Meta box
- remove duplicate name submenu link from the custom post type
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- Modify Publish Metabox location on CPT
- Convert category to custom post type
- Restrict Custom Post Type to One Item
- subtracting the current post form then whole loop, which is generating all CPT titles
- Custom Function to redirect singular post if specific meta field is empty
- How to mix 2 kinds of post types
- Edit single page from plugin
- How to shows CPT which has specific meta key?
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Show custom post type under last posts configuration
- Manually build WP_Query
- custom post type loop
- Custom Post save causes 500 error
- Optimise custom post type queries
- WordPress Custom Post Type and sort by Tags
- Archive page of filtered posts
- Custom post type child of custom post type
- delete custom post type using a submit form
- single-mySlug.php works: archive-mySlug.php does not. Custom Post Type
- Custom post type navigation – 404 on page 2
- Problem with custom post type search
- No error in debug mode, wordpress template can not be loaded
- Rewrite nested urls for custom post type
- Custom Post Type featured option
- Rewrite rule taxonomy url with different values in one function