我想在查看单个帖子时附加URL。例如,当im在帖子上时,我希望url类似于:example.com/mypage/mypage/single-post-article
默认url为example.com/single-post-article
我没有在WPSE或goooglz上找到什么,但我已经读到了wp-rewrite
并且尝试过add_post_type_support
到post
但运气不好!
add_post_type_support( \'post\', array(
\'rewrite\' => array(\'slug\' => \'/bla/bla/\')
));
我需要使用
wp_rewrite
?
Update
我是通过跑步来完成的
register_post_type
在post\\u上再次键入“post”。但这是最好的方式吗?
register_post_type( \'post\', array(
\'public\' => true,
\'_builtin\' => false,
\'_edit_link\' => \'post.php?post=%d\',
\'capability_type\' => \'post\',
\'map_meta_cap\' => true,
\'hierarchical\' => false,
\'rewrite\' => array( \'slug\' => \'/mypage/mypage\' ),
\'query_var\' => false,
\'pages\' => false,
\'supports\' => array(
\'title\',
\'editor\',
\'author\',
\'thumbnail\',
\'excerpt\',
\'revisions
),
));