Wordpress Custom Permalink for Just Posts

风格不统一 提交于 2019-11-28 09:11:27

You simply have to set /blog/%postname%/ as your permalinks structure, this will not change your pages permalinks.

And to keep your portfolio permalinks, you should set with_front to false when you register this post type.

'with_front' => bool Should the permastruct be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true

EDIT 1 : You should probably flush Wordpress rewrite rules after that.

EDIT 2 : with_front param is a rewrite param :

'rewrite' => array('slug' => 'portfolio', 'with_front' => false),
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!