我的自定义帖子类型有点问题。。。我的帖子类型叫做“视频”。我把所有的帖子都用“single”显示在他们的单页上。php的模板。但是当我从url中删除帖子名称并保留/videos/时,我得到了一个404,但我想在这里列出所有的“视频”。我尝试使用存档视频。法典建议的php文件:http://codex.wordpress.org/Post_Types, 还是没有运气。它还说,你可以做单一的视频。php用于自定义帖子类型,但这也不起作用。我将在下面显示我用于注册帖子类型的代码,我是否做错了什么?
add_action(\'init\', \'videos_register\');
function videos_register() {
$labels = array(
\'name\' => _x(\'Videos\', \'post type general name\'),
\'singular_name\' => _x(\'Video\', \'post type singular name\'),
\'add_new\' => _x(\'Add New\', \'question\'),
\'add_new_item\' => __(\'Add New Video\'),
\'edit_item\' => __(\'Edit Video\'),
\'new_item\' => __(\'New Video\'),
\'view_item\' => __(\'View Video\'),
\'search_items\' => __(\'Search Videos\'),
\'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,
\'menu_icon\' => get_stylesheet_directory_uri() . \'/article16.png\',
\'rewrite\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'menu_position\' => null,
\'supports\' => array(\'title\',\'editor\',\'thumbnail\')
);
register_post_type( \'videos\' , $args );
flush_rewrite_rules();
}