admin管理员组文章数量:1130349
My Wordpress default category has 'news' category term. I created custom post type with name 'artist' and custom taxonomy named 'genre'. Now what I set in permalink section is below
custom structure - /news/%category%/%postname%/
because I want to open all my default post open with 'news' slug. I create page taxonomy-genre.php which lead to all post of genre taxonomy. let say genre taxonpmy has term 'afro-pop'. Now when I view the page it display all post of 'afro-pop' but problem is that it has url
http://localhost/mn2s-new/news/genre/afro-pop/
what I want is
http://localhost/mn2s-new/genre/afro-pop/
I want to remove that news slug for taxonomy-genre.php page. Please help me with this I am trying from 2 days but doesn't find any solution.
My Wordpress default category has 'news' category term. I created custom post type with name 'artist' and custom taxonomy named 'genre'. Now what I set in permalink section is below
custom structure - /news/%category%/%postname%/
because I want to open all my default post open with 'news' slug. I create page taxonomy-genre.php which lead to all post of genre taxonomy. let say genre taxonpmy has term 'afro-pop'. Now when I view the page it display all post of 'afro-pop' but problem is that it has url
http://localhost/mn2s-new/news/genre/afro-pop/
what I want is
http://localhost/mn2s-new/genre/afro-pop/
I want to remove that news slug for taxonomy-genre.php page. Please help me with this I am trying from 2 days but doesn't find any solution.
Share Improve this question edited Dec 13, 2018 at 15:49 fuxia♦ 107k39 gold badges255 silver badges461 bronze badges asked Dec 13, 2018 at 5:51 Krishna thakorKrishna thakor 11 silver badge3 bronze badges1 Answer
Reset to default 3This is controlled by the with_front argument in your taxonomy registration code:
register_taxonomy(
'genre',
'artist',
array(
'rewrite' => array(
'slug' => 'genre',
'with_front' => false, // don't prepend static prefix from post permalink
),
// your other args...
)
);
My Wordpress default category has 'news' category term. I created custom post type with name 'artist' and custom taxonomy named 'genre'. Now what I set in permalink section is below
custom structure - /news/%category%/%postname%/
because I want to open all my default post open with 'news' slug. I create page taxonomy-genre.php which lead to all post of genre taxonomy. let say genre taxonpmy has term 'afro-pop'. Now when I view the page it display all post of 'afro-pop' but problem is that it has url
http://localhost/mn2s-new/news/genre/afro-pop/
what I want is
http://localhost/mn2s-new/genre/afro-pop/
I want to remove that news slug for taxonomy-genre.php page. Please help me with this I am trying from 2 days but doesn't find any solution.
My Wordpress default category has 'news' category term. I created custom post type with name 'artist' and custom taxonomy named 'genre'. Now what I set in permalink section is below
custom structure - /news/%category%/%postname%/
because I want to open all my default post open with 'news' slug. I create page taxonomy-genre.php which lead to all post of genre taxonomy. let say genre taxonpmy has term 'afro-pop'. Now when I view the page it display all post of 'afro-pop' but problem is that it has url
http://localhost/mn2s-new/news/genre/afro-pop/
what I want is
http://localhost/mn2s-new/genre/afro-pop/
I want to remove that news slug for taxonomy-genre.php page. Please help me with this I am trying from 2 days but doesn't find any solution.
Share Improve this question edited Dec 13, 2018 at 15:49 fuxia♦ 107k39 gold badges255 silver badges461 bronze badges asked Dec 13, 2018 at 5:51 Krishna thakorKrishna thakor 11 silver badge3 bronze badges1 Answer
Reset to default 3This is controlled by the with_front argument in your taxonomy registration code:
register_taxonomy(
'genre',
'artist',
array(
'rewrite' => array(
'slug' => 'genre',
'with_front' => false, // don't prepend static prefix from post permalink
),
// your other args...
)
);
本文标签: permalinksHow to change url for taxonomy pages
版权声明:本文标题:permalinks - How to change url for taxonomy pages? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749102004a2316133.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论