博客文章的永久链接结构与Wordpress中的页面不同吗? [英] Different permalink structure for blog posts than pages in Wordpress?
问题描述
我希望帖子的永久链接结构与Wordpress网站上的页面不同.
I'd like to have a different permalink structure for posts than for pages on a Wordpress website.
例如,博客文章名称"This is a nice blog post"将获得永久链接: /blog/this-is-a-nice-blog-post
For example, a blog post name "This is a nice blog post" would get the permalink : /blog/this-is-a-nice-blog-post
其中一个名为所提供的服务"的页面将获得固定链接: /services
where as a page called "Services Offered" would get the permalink : /services-offered
我知道我应该在永久链接结构中使用%postname%,但是如何仅将前缀/blog/添加到那些博客文章中?
I know I should use the %postname% in the permalink structure, but how to add the prefix /blog/ to only those blog posts ?
提前谢谢!
推荐答案
在永久链接设置下,您需要使用自定义格式.为此,您需要查看可使用的结构标签.这些可以在这里找到:
Under the permalink settings, you need to use a custom format. To do this, you'll need to take a look at the structure tags available for use. Those can be found here:
http://codex.wordpress.org/Using_Permalinks
要完全执行您想要的操作,您想要使用以下格式:
To do exactly what you're wanting, you'd want to use a format like this:
/%category%/%postname%/
/%category%/%postname%/
页面没有类别,因此类别标签将被忽略,而仅使用帖子名称标签.
Pages have no category, so the tag for categories gets ignored and only the post name tag gets used.
我刚发现这个问题正在寻找相同的答案.希望这不会太晚并能帮助您.
I just found this question looking for the same answer. Hope this isn't too late and helps you out.
这篇关于博客文章的永久链接结构与Wordpress中的页面不同吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!