drll42469 2018-08-21 11:35
浏览 61

类别不会显示在页面网址wordpress

I'm trying to get category in my page url in WordPress, but I cannot get it to work correctly. I've tried to go to settings > permalinks and chose the custom structure and added these parameters: /%category%/%postname%/, but the site url does not update. After adding the parameters and refreshing the page normally aswell as with a cache flush a page with a category assigned to it does not have the site url updated, the postname seems to function correctly though.

Currently there is only one plugin running on the website, Events Manager, other then that I'm running the latest WordPress version.

I added the category functionality in my functions.php file with the following code.

    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' );

Can somebody please help me?

  • 写回答

1条回答 默认 最新

  • doucheng1884 2018-08-21 11:59
    关注

    You can also manage taxonomies in the backend and build the url with the possible parameters.

    enter image description here

    However maybe just resaving your post will solve the problem.

    Otherwise check this documentation from wp-beginner.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大