duannaikuang1301 2017-10-17 09:40
浏览 18

类别中的重复slu [[WordPress]

First of all, let me explain the problem.

The following happens when I make categories with similar names: https://www.example.com/cars/ford/parts
https://www.example.com/cars/toyota/parts1

Why is this the case? The parents are different so why would WordPress at a 1 to the second parts category?

Is there a workaround for this?
I saw numerous people with the same issue. Would be nice if there was a way for them to have the same slugs when the parent's slug is different.

  • 写回答

2条回答 默认 最新

  • drdu53813 2017-10-17 10:43
    关注

    I have never quite suffered enough to figure out why it happens, but I can confirm that it happens. I've only had to deal with a cleanup, but nobody wanted to add additional categories, so my lazyness stopped me after a simple fix.

    What I've done was directly working on WP's tables (wp_terms and wp_term_taxonomy), setting the correct term_id on the wp_term_taxonomy-item that was created with the second (duplicate) term, thus getting a different slug. This was a straight forward, pretty harmless action, because it doesn't change the term_taxonomy_id and therefore didn't concern wp_term_relationships at all.

    As usual when manipulating the data directly, do it on a dev installation first.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看