Title: CSS classes not assigned correctly
Last modified: August 22, 2016

---

# CSS classes not assigned correctly

 *  Resolved [istarnet](https://wordpress.org/support/users/istarnet/)
 * (@istarnet)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-classes-not-assigned-correctly/)
 * First, this plugin works great, as far as it goes. It is the only off-the-shelf
   plugin that worked for me. The problem is: I cannot use the Appearance – Menus
   interface to add a custom class to the menu items.
 * Suppose I have a CPT called ‘my_cpt’ and I’ve added it to the menu. When I visit
   the Appearance – Menus page and twist open the menu, the value in the text box
   for custom class says: post-type-archive-my_cpt. This would be excellent but…
 * When I view source or inspect the
 * `<li>` element for the menu item, the class assigned is an ‘item-‘ class derived
   from a seemingly random post within the custom post type. So then, I want to 
   change that so I head back over to Appearance – Menu. If I enter an unique custom
   class name and save the menu, that custom class is *not* added to the `</li>`
   `
   <li>`. The unique custom class name remains in the box for the custom class for
   the item but the random ‘item-…’ class remains assigned to the `</li>` `<li>`.
   I believe that the plugin is totally usable as is. It seems that the CSS classes
   assigned to the menu items are permanent. It just that the cool WordPress feature
   where you can assign your own custom classes is not working.
 * After my project completes, I’ll try to take a look at the code and post a fix
   if I find one. Until then, if the developer releases a new version that handles
   classes correctly, I’d be very happy indeed.
 * Best, Regards…
    [https://wordpress.org/plugins/post-type-archive-in-menu/](https://wordpress.org/plugins/post-type-archive-in-menu/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [istarnet](https://wordpress.org/support/users/istarnet/)
 * (@istarnet)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-classes-not-assigned-correctly/#post-5283587)
 * I am quite confused at this point. I still cannot assign custom classes but I
   don’t know why. I’ve deactivated this and other plugins but the problem remains.
   I think my database might be corrupted. More if is get a clue.
 *  Thread Starter [istarnet](https://wordpress.org/support/users/istarnet/)
 * (@istarnet)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-classes-not-assigned-correctly/#post-5283597)
 * Falsely accused! The plugin is perfect. My theme is overwriting classes on menu
   items. I have no idea why but the theme has a low priority filter that totally
   replaces classes on menu items. I had written a high priority filter to work 
   around the problem but my workaround was being overwritten. I highly recommend
   this plugin. It solves my needs perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘CSS classes not assigned correctly’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/post-type-archive-in-menu_fcfcfc.
   svg)
 * [Post type archive in menu](https://wordpress.org/plugins/post-type-archive-in-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-type-archive-in-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-type-archive-in-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/post-type-archive-in-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-type-archive-in-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-type-archive-in-menu/reviews/)

## Tags

 * [class](https://wordpress.org/support/topic-tag/class/)
 * [css](https://wordpress.org/support/topic-tag/css/)

 * 2 replies
 * 1 participant
 * Last reply from: [istarnet](https://wordpress.org/support/users/istarnet/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/css-classes-not-assigned-correctly/#post-5283597)
 * Status: resolved