admin管理员组文章数量:1277903
I have a Wordpress site that has been up and running for some years using the custom permalink structure of: /%postname%/
This is fine, except I want to launch a special section in which posts go in a directory, for example: /special/%postname%/
What's the proper way to go about this? A custom post type would work, but honestly the template and post type is just an article.
I think there is a way to do this with a rewrite, something like
function append_query_string( $url, $post, $leavename=false ) {
if ( $category->term_id == 'special' ) {
$url = add_query_arg( 'special', $url );
}
return $url;
}
add_filter( 'post_link', 'append_query_string', 10, 3 );
but I'm just starting and could use some pointers. Thanks!
本文标签: categoriesOne Specific Category To Permalink
版权声明:本文标题:categories - One Specific Category To Permalink 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741248335a2365316.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论