【发布时间】:2012-08-27 07:07:34
【问题描述】:
在 Woothemes 的列表主题中,孩子是 Bookclub。 当我添加一本书时 - 作为自定义帖子类型 - 网址如下:
mysite/book/post-name
我试图删除蛞蝓“书”,但我失败了 我希望它是
mysite/post-name
【问题讨论】:
标签: wordpress url wordpress-theming slug permalinks
在 Woothemes 的列表主题中,孩子是 Bookclub。 当我添加一本书时 - 作为自定义帖子类型 - 网址如下:
mysite/book/post-name
我试图删除蛞蝓“书”,但我失败了 我希望它是
mysite/post-name
【问题讨论】:
标签: wordpress url wordpress-theming slug permalinks
比为此安装一个完整的插件要好得多。
用 4.3 测试:
register_post_type( 'dummy', array(
//other custom posttype definitions
'rewrite' => array('slug' => '/')
) );
在此之后保存您的重写规则以使其工作。
【讨论】:
其实很简单,安装插件“Remove slug from custom post type”来删除'/product/' slug,不需要设置。安装插件“SEO Ultimate”以删除“产品类别”slug,在“Permalink Tweaker”下的 SEO Ultimate 设置中检查“产品类别”并保存。我们将其用于关联公司,因此无法对购物车等其他区域发表评论。
【讨论】:
我不知道这个插件的效果如何,但你去吧。
http://wordpress.org/extend/plugins/remove-slug-from-custom-post-type/
【讨论】: