在我的主题中,我创建了一个新的自定义帖子类型webinar
. 因为我们只发布了1条webinar
每月,我们希望使用permalink结构-
/webinar/%year%/%monthnum%/
我们不使用的地方/%day%/
和/或/%postname%/
这可能吗?
当前它显示为一个月存档,其中
/webinar/2018/08/
有标题Archives for August 2018
不仅仅是一个帖子<小时>Attributes:
WordPress(4.9.8)
Genesis框架(2.6.1)
Dynamic主题(2.3.1)
https://cobaltapps.com
我正在使用自定义帖子类型UI插件创建我的自定义帖子类型-https://wordpress.org/plugins/custom-post-type-ui/
它自动生成以下代码-
function cptui_register_my_cpts_webinars() {
/**
* Post Type: Webinars.
*/
$labels = array(
"name" => __( "Webinars", "" ),
"singular_name" => __( "Webinar", "" ),
"menu_name" => __( "UDEO Webinars", "" ),
"all_items" => __( "All Webinars", "" ),
"add_new" => __( "Add New", "" ),
"add_new_item" => __( "Add New Webinar", "" ),
"edit_item" => __( "Edit Webinar", "" ),
"new_item" => __( "New Webinar", "" ),
"view_item" => __( "View Webinar", "" ),
"view_items" => __( "View Webinars", "" ),
"search_items" => __( "Search Webinar", "" ),
"not_found" => __( "No Webinars Found", "" ),
"not_found_in_trash" => __( "No Webinars found in Trash", "" ),
"archives" => __( "Webinar Archives", "" ),
);
$args = array(
"label" => __( "Webinars", "" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => array( "slug" => "webinars", "with_front" => true ),
"query_var" => true,
"supports" => array( "title", "editor", "thumbnail", "custom-fields", "comments", "author" ),
);
register_post_type( "webinars", $args );
}
add_action( \'init\', \'cptui_register_my_cpts_webinars\' );