1

I have been trying to get the current menu item to my custom post types. I cannot get it to work, and when looking at my menu, I am wondering, that if everything is allright.

Which are the correct classes WordPress should generate, when displaying pages, archives and custom post types?

I have this link explaning them: http://premium.wpmudev.org/blog/wordpress-menu-css/

But my page for example has the following classes:

menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-146 current_page_item menu-item-147

And my custom post type:

menu-item menu-item-type-taxonomy menu-item-object-category menu-item-187

Which seems strange, since the menu is a link to the category and archive page, not a taxonomy?

Thanks in advance

3
  • 1
    The link that you posted explain well which classes WordPress generate for menu items. Which class is strange for you in example you have posted? Consider that categories are type of taxonomies.
    – jep
    Jan 2, 2015 at 10:36
  • 1
    The taxonomy archive menus have the classes menu-item-type-taxonomy and menu-item-object-{taxonomy-name}, so there is nothing strange because category is a taxonomy (here you are wrong when say that "the menu is a link to the category and archive page, not a taxonomy"
    – cybmeta
    Jan 2, 2015 at 10:51
  • @cybmeta as an answer please :)
    – Rarst
    Jan 2, 2015 at 16:27

1 Answer 1

1

The taxonomy archive menus have the classes menu-item-type-taxonomy and menu-item-object-{taxonomy-name}, so there is nothing strange because category is a taxonomy (here you are wrong when say that "the menu is a link to the category and archive page, not a taxonomy").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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