I am not able to rewrite custom post type permalink.
$labels = array(
'name' => __('VmGallery', THEME_TEXT_DOMAIN, THEME_TEXT_DOMAIN),
'singular_name' => __('VmGallery', THEME_TEXT_DOMAIN),
'add_new' => __('Add New', THEME_TEXT_DOMAIN),
'add_new_item' => __('Add New Gallery', THEME_TEXT_DOMAIN),
'edit_item' => __('Edit Gallery', THEME_TEXT_DOMAIN),
'new_item' => __('New Gallery', THEME_TEXT_DOMAIN),
'all_items' => __('All Galleries', THEME_TEXT_DOMAIN),
'view_item' => __('View Gallery', THEME_TEXT_DOMAIN),
'search_items' => __('Search Gallery', THEME_TEXT_DOMAIN),
'not_found' => __('No galleries found', THEME_TEXT_DOMAIN),
'not_found_in_trash' => __('No galleries found in the Trash', THEME_TEXT_DOMAIN),
'parent_item_colon' => '',
'menu_name' => __('Gallery', THEME_TEXT_DOMAIN),
);
$supports = array('title', 'editor', 'thumbnail', 'excerpt', 'comments', 'custom-fields', 'post-formats', 'author', 'excerpt');
$args = array(
'labels' => $labels,
'description' => 'Galleries specific information',
'public' => true,
'menu_position' => 6,
'menu_icon' => 'dashicons-format-image',
'supports' => $supports,
'taxonomies' => array('gallery_categories', 'post_tag'),
'has_archive' => 'ggg'
/*'rewrite' => array(
'slug' => $slug,
'with_front' => false
),*/
);
register_post_type('vmgallery', $args);
I have php file: archive-vmgallery.php
I think that it should be loaded when URL is myurl.com/ggg
. But it shows 404 error page instead.
If I use post type instead of 'ggg': myurl.com/vmgallery, then archive-vmgallery.php
is loaded. Why? I thought that 'has_archive' => 'ggg' allows to rewrite slug?