Title: Menu css class not working properly
Last modified: April 5, 2018

---

# Menu css class not working properly

 *  Resolved [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/)
 * (@mlgz0rn2)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/)
 * So i’m trying to add a css class to one of my menu items.
    But for some reason
   the css class gets added wrong, which makes it not working. I am trying to show
   the content of that menu item in a popup.
 *     ```
       <ul class="sf-dropdown-menu" style="display: none;">
       	<li class="menu-april menu-item-930">
                  <a href="http://gedevasevang.dk/maanedsblad/april/">
                  <i class="modal-link"></i>April</a>
              </li>
       </ul>
       ```
   
 * The css class gets added as <i class=”modal-link”></i> which makes it not working.
   
   For it to work it needs to be within the link itself.
 * Like so
 *     ```
       <ul class="sf-dropdown-menu" style="display: none;">
       	<li class="menu-april menu-item-930">
                    <a class="modal-link" href="http://gedevasevang.dk/maanedsblad/april/">April</a> 
               </li>
       </ul>
       ```
   
 * Is there somehow any way to fix this?
    Is it something on my page that is adding
   the css class in a wrong way? Or is this intended?
 * Best Regards
    -  This topic was modified 8 years, 2 months ago by [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/).
    -  This topic was modified 8 years, 2 months ago by [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/).
    -  This topic was modified 8 years, 2 months ago by [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmenu-css-class-not-working-properly%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [hannah](https://wordpress.org/support/users/hannahritner/)
 * (@hannahritner)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10150423)
 * Hi [@mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/),
    Sorry, I’m not
   sure I’m following. Can you link to an example of what you’re wanting? Thank 
   you!
 * Hannah
 *  Thread Starter [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/)
 * (@mlgz0rn2)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10152924)
 * Alright let me try again :p
    I’m not sure if it’s related to the virtue theme.
 * the css class i’m wanting to add, makes it so when you click a link/menu item
   and so, the content of that link will show up in a popup window.
 * As shown in the image here [img1](https://i.imgur.com/Ef69frh.png)
 * I’m using the advanced setting under menus to add a css class to the item.
    [img2](https://i.imgur.com/P2LX0es.png)
 * But this adds the class like shown on this picture
    [img3](https://i.imgur.com/RGqlrWb.png)
   Because of that, it takes me directly to the link when clicked. [img4](https://i.imgur.com/GcSUDiA.png)
 * If I then change it to how I want it to be in the chrome developertools, it works
   perfectly
    [img5](https://i.imgur.com/SXucsxY.png)
 * So to me, it seems like css classes are getting added in the wrong way to the
   menu items, using the advanced setting.
    Again, I do not know if this is virtue
   being the cause of it. But when ever I google how to add custom css classes to
   a nav item, it shows me to do it like I did, but they get different results.
 * I hope this cleared things up abit on my issue 🙂
    -  This reply was modified 8 years, 2 months ago by [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/).
 *  [Kevin](https://wordpress.org/support/users/jx-3p/)
 * (@jx-3p)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10154761)
 * Hey,
 * With the theme, the CSS class is used to add icons to menus, see here:
    [https://www.kadencethemes.com/add-icons-to-your-menu/](https://www.kadencethemes.com/add-icons-to-your-menu/)
 * Each menu item by default has it’s own unique CSS class though, so perhaps we
   could use one of those classes instead? (menu-april or menu-item-930)
 * -Kevin
 *  Thread Starter [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/)
 * (@mlgz0rn2)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10160679)
 * Hey [@jx-3p](https://wordpress.org/support/users/jx-3p/) how would I be able 
   to do that?
 * Best Regards
 *  [Kevin](https://wordpress.org/support/users/jx-3p/)
 * (@jx-3p)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10161807)
 * In IMG 3 in your above post, take note of the classes that I pointed out, above
   where the “modal-link” class is being added. Try using one of the pre-generated
   classes.
 * Does that work for you?
 * -Kevin
 *  Thread Starter [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/)
 * (@mlgz0rn2)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10163119)
 * The problem is, it’s a plugin I use to do the popups, which wants me to add that
   class to links/items and so on for it to show in a popup.
    It seems like alot
   of hassle if I have to take everything from that plugin and it’s css and add 
   it to every single nav item I want it added too. When in theory I could just 
   add 1 class.
 * Am I completely wrong here, and misunderstanding what you are saying? 😀
 *  [Kevin](https://wordpress.org/support/users/jx-3p/)
 * (@jx-3p)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10163132)
 * Ok, I understand what you need now. Sorry it took a moment! I’ll send this onto
   the theme developer so that he can provide a solution ASAP.
 * -Kevin
 *  Thread Starter [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/)
 * (@mlgz0rn2)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10163136)
 * Awesome! Thank you so much!
 *  [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10163160)
 * Hey,
    I see, the theme allows for icons and moves that custom icon input into
   an output for icons, see this demo: [http://themes.kadencethemes.com/virtue2/](http://themes.kadencethemes.com/virtue2/)
 * I’ll update today with a check to see if it’s an icon that being added and if
   it isn’t to add that class into the right spot.
 * Ben
 *  Thread Starter [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/)
 * (@mlgz0rn2)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10163167)
 * Sounds good! Thanks for all the help!
 *  Thread Starter [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/)
 * (@mlgz0rn2)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10164474)
 * Works great now! thank you so much

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

The topic ‘Menu css class not working properly’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/virtue/3.4.15/screenshot.png)
 * Virtue
 * [Support Threads](https://wordpress.org/support/theme/virtue/)
 * [Active Topics](https://wordpress.org/support/theme/virtue/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/virtue/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/virtue/reviews/)

 * 11 replies
 * 4 participants
 * Last reply from: [mlgz0rn2](https://wordpress.org/support/users/mlgz0rn2/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/menu-css-class-not-working-properly/#post-10164474)
 * Status: resolved