• Hi,

    I’m experiencing some weird crossovers between my custom taxonomies and the built-in category and tags. I hope someone can help.

    I’ve created a custom post type (projects) and a custom taxonomy (sectors) that is exclusive to that post type. Then I created a custom menu (via Appearance -> Menus) that outputs the various sectors and allows the user to view projects by sector. So far so good.

    However, the site also contains a blog with the standard posts, categories and tags. The problem arises when you create a category or tag with the same name as one of the sectors. So if I have “Commercial” as a sector, and then create a “Commercial” category or tag, clicking the “Commercial” category / tag calls up all blog posts with that category / tag but also causes the “current-menu-item” class to be applied to “Commercial” in the sectors menu.

    This wouldn’t be a big issue by itself (and can be hacked in the CSS) but if I subsequently delete the “Commercial” category / tag, then the “Commercial” sector is removed from the menu (though thankfully it is not deleted from the system).

    I hope I’ve explained it clearly and I hope someone can help with this issue as I’m at the tearing-my-hair-out stage. Is this a known bug? Is there a workaround? Should I simply give up on the inbuilt custom menu and build the sector menu myself using get_terms?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Just a guess, but this sounds like a permalink problem because of the way WP builds permalinks. Try switching to the default permalinks and see if the problem goes away. If it does, you might need to modify your permalink structure (but I am no permalink expert and can’t say how).

    Thread Starter JimFitzsimons

    (@jimfitzsimons)

    Thanks for your response vtxyzzy. It may well be a permalink issue, but it just seemed easier to abandon the built-in menu system and build the Sectors menu ‘manually’ using get_terms()… which is now working fine.

    Maybe when I don’t have a deadline looming I’ll go back and try to work it out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom taxonomy menu problem’ is closed to new replies.