自定义分类页面返回404

时间:2012-08-28 作者:Klian

我创建了一个自定义帖子类型和一个自定义分类法。我可以创建新帖子并分配这些分类法,但当我转到mydomain.com/mycustomtaxonomy/termslug.

这是我的代码:

$labels = array(
    \'name\' => _x(\'Videos\', \'post type general name\'),
    \'singular_name\' => _x(\'Video\', \'post type singular name\'),
    \'add_new\' => _x(\'Nuevo\', \'portfolio item\'),
    \'add_new_item\' => __(\'Nuevo video\'),
    \'edit_item\' => __(\'Editar video\'),
    \'new_item\' => __(\'Nuevo video\'),
    \'view_item\' => __(\'Ver videos\'),
    \'search_items\' => __(\'Buscar 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,
    \'rewrite\' => true,
    \'capability_type\' => \'post\',
    \'rewrite\' => array("slug" => "video"),
    \'hierarchical\' => true,
    \'menu_position\' => 5,
    \'supports\' => array(\'title\', \'editor\', \'thumbnail\', \'page-attributes\')
); 

register_post_type( \'videos\' , $args );
flush_rewrite_rules();

// Register custom taxonomy

register_taxonomy("familia_videos", array("videos"), array("hierarchical" => true, "label" => "Categorias de Videos", "singular_label" => "Categoria de videos", \'rewrite\' => true  ));
以及我的permalink结构:

/%postname%/
我创建了:taxonomy-familia\\u视频。php

我刷新了permalinks结构,但我总是得到404。

有什么帮助吗?

谢谢

1 个回复
SO网友:MadtownLems

但当我转到mydomain时,它返回404。com/mycustomtaxonomy

问题是你期望的行为根本不存在。就像我的网站一样。com/category将是404,mysite也将是404。com/mycustomtaxonomy

结束

相关推荐