Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have created a custom menu for each of my categories (to show subcategories of each category on that category page) and that menu will have the exact same name as the category name.

The weird thing that happened is that when I changed the name of the custom menu, the name of the category also changed and the permalink of that category changed as well and so I get a 404 error page when I try to open the category page.

Is it just me or is this a bug or am I doing something wrong here?
I tried it on 2 different WP installations and both showed the same behavior. I searched WP docs for this but failed to get anything related to this.

Is there some sort of linking between the custom menu names and category name if they exactly the same?

share|improve this question
add comment

1 Answer

Nav Menus are actually taxonomies -- eg. they are registered with register_taxonomy and get used to associated menu items (which are, of course, a custom post type!).

Slugs, which is what you're trying to use here, have to be unique for a taxonomy term, this is enforced on the database level (not 100% sure on this). So there's probably some logic inside wp_insert_term that changes the slugs to be unique.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.