简体   繁体   English

在“自定义帖子类型帖子”上的链接中看不到类别名称

[英]Can't see the category name in the link on Custom Post Type Post

I have a custom post type 'Games' and have some categories i have added. 我有一个自定义帖子类型“游戏”,并且添加了一些类别。 when i have created a post and select the category it won't show the category name in the link. 当我创建一个帖子并选择类别时,它不会在链接中显示类别名称。

For example: 例如:

test.onlinegame.com/games/poker/poker-game-name test.onlinegame.com/games/poker/poker-game-name

But when i view the post it shows only 但是当我查看帖子时,它仅显示

test.onlinegame.com/games/poker-game-name test.onlinegame.com/games/poker-game-name

Is their anything have to add code when i register Taxonomy or when i register Custom post type? 当我注册分类法或注册自定义帖子类型时,它们的内容是否需要添加代码?

Can you please tell why its not showing category name in the url? 您能告诉我为什么它不在URL中显示类别名称吗?

thanks 谢谢

You need to change permalink structure. 您需要更改永久链接结构。 wp-admin->setting->permalink and change Custom Structure: wp-admin-> setting->永久链接并更改自定义结构:

test.onlinegame.com/%category%/%postname%/

https://codex.wordpress.org/Using_Permalinks https://codex.wordpress.org/Using_Permalinks

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM