我已经创建了自定义帖子类型,本月和下月创建了两个帖子类别,并为每个类别分配了示例帖子。预览类别存档时/分类/本月有一个页面未显示任何内容,因此我假设该页面存在,但帖子未显示。问题是,我如何才能使分配给帖子类别的帖子在say/category/this month上显示?
// Register Custom Post Type
function activity() {
$labels = array(
\'name\' => _x( \'Activity\', \'Post Type General Name\', \'twenty_two\' ),
\'singular_name\' => _x( \'Activity\', \'Post Type Singular Name\', \'twenty_two\' ),
\'menu_name\' => __( \'Activity\', \'twenty_two\' ),
\'name_admin_bar\' => __( \'Activity\', \'twenty_two\' ),
\'archives\' => __( \'Item Archives\', \'twenty_two\' ),
\'attributes\' => __( \'Item Attributes\', \'twenty_two\' ),
\'parent_item_colon\' => __( \'Parent Product:\', \'twenty_two\' ),
\'all_items\' => __( \'All Activity\', \'twenty_two\' ),
\'add_new_item\' => __( \'Add New Activity\', \'twenty_two\' ),
\'add_new\' => __( \'New Activity\', \'twenty_two\' ),
\'new_item\' => __( \'New Item\', \'twenty_two\' ),
\'edit_item\' => __( \'Edit Activity\', \'twenty_two\' ),
\'update_item\' => __( \'Update Activity\', \'twenty_two\' ),
\'view_item\' => __( \'View Activity\', \'twenty_two\' ),
\'view_items\' => __( \'View Items\', \'twenty_two\' ),
\'search_items\' => __( \'Search Activity\', \'twenty_two\' ),
\'not_found\' => __( \'No Activity found\', \'twenty_two\' ),
\'not_found_in_trash\' => __( \'No products found in Trash\', \'twenty_two\' ),
\'featured_image\' => __( \'Featured Image\', \'twenty_two\' ),
\'set_featured_image\' => __( \'Set featured image\', \'twenty_two\' ),
\'remove_featured_image\' => __( \'Remove featured image\', \'twenty_two\' ),
\'use_featured_image\' => __( \'Use as featured image\', \'twenty_two\' ),
\'insert_into_item\' => __( \'Insert into item\', \'twenty_two\' ),
\'uploaded_to_this_item\' => __( \'Uploaded to this item\', \'twenty_two\' ),
\'items_list\' => __( \'Items list\', \'twenty_two\' ),
\'items_list_navigation\' => __( \'Items list navigation\', \'twenty_two\' ),
\'filter_items_list\' => __( \'Filter items list\', \'twenty_two\' ),
);
$args = array(
\'label\' => __( \'Activity\', \'twenty_two\' ),
\'description\' => __( \'Display activities post\', \'twenty_two\' ),
\'labels\' => $labels,
\'supports\' => array( \'title\', \'editor\', \'thumbnail\' ),
\'taxonomies\' => array( \'category\', \'post_tag\' ),
\'hierarchical\' => false,
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'menu_position\' => 5,
\'show_in_admin_bar\' => true,
\'show_in_nav_menus\' => true,
\'can_export\' => true,
\'has_archive\' => \'activities\',
\'exclude_from_search\' => false,
\'publicly_queryable\' => true,
\'capability_type\' => \'page\',
);
register_post_type( \'activity\', $args );
}
add_action( \'init\', \'activity\', 0 );