我试图从url中删除portfolio视图,并按照指示从突出显示的部分删除它的名称。这是可行的,但让我与‘投资组合’,现在,即使字段是空白。这段代码有什么问题,或者需要在面包屑中进行修改?它现在从某个地方抓取‘投资组合’,我想把这个藏在网址里。
我试着得到:http://www.sitename.com/post而不是http//www.sitename.com/portfolio/post。
/* Portfolio */
function my_post_type_portfolio() {
register_post_type( 'portfolio',
array(
'label' => __('Portfolio'),
'singular_label' => __('Porfolio Item', 'theme'),
'_builtin' => false,
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'capability_type' => 'page',
'menu_icon' => get_template_directory_uri() . '/includes/images/icon_portfolio.png',
**'rewrite' => array(
'slug' => ' ',
'with_front' =>false,**
),
'supports' => array(
'title',
'editor',
'thumbnail',
'excerpt',
'custom-fields',
'comments')
)
);
register_taxonomy('portfoliocat', 'portfolio', array('hierarchical' => true, 'label' => 'Portfolio Categories', 'singular_name' => 'Category', "rewrite" => true, "query_var" => true));
}
add_action('init', 'my_post_type_portfolio'); 面包屑设置为:<a title="Go to %title%." href="%link%">%htitle%</a>
Permalinks:/%postname%/
发布于 2012-08-31 13:34:06
https://wordpress.stackexchange.com/questions/63722
复制相似问题