如何更改页面的永久链接(不是博客文章)?

时间:2020-10-02 12:33:54

标签: wordpress permalinks

我实际上想实现一些简单的操作,但是找不到解决方案。为此,我希望将它们应用于页面或不应用于页面,而不是对帖子应用永久链接。

理想情况下,我想在永久链接中包含类别。 例如:

http://www.example.com/earth/somepage
http://www.example.com/mars/anotherpage

*其中[地球和火星]是类别。 [somepage和anotherpage]是页面的标题。

在此示例中,我注册了类别和标签分类法

    function myplugin_settings() {  
    // Add tag metabox to page
    register_taxonomy_for_object_type('post_tag', 'page'); 
    // Add category metabox to page
    register_taxonomy_for_object_type('category', 'page');  
}
 // Add to the admin_init hook of your theme functions.php file 
add_action( 'init', 'myplugin_settings' );

我遇到的所有提供的解决方案均适用于帖子。我想念什么?

0 个答案:

没有答案