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://ww.wp.xz.cn/plugins/post-type-archive-in-menu/
The topic ‘CSS classes not assigned correctly’ is closed to new replies.