• Resolved softteam

    (@softteam)


    Is it possible to add a CSS class for the menu item which is visible only after login?
    It will be great to have it special for responsive/mobile view – so the user can see directly the new menu items after login.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @softteam – I’m not sure I follow. The hidden menu items are not hidden per say, they are actually removed from the menu. So the page has to reload which is generally required to see other changes on the page after login as well.

    If I understand you correctly and your using some type of AJAX login, its not gonna work without a ton of work on your part to get info from the login response & then dynamically insert it around the page. Otherwise the way WP works by default the page reloading will make the use of classes un-needed. The menu items will already be visible after the page refreshes without the need for CSS.

    Hope that helps.

    Thread Starter softteam

    (@softteam)

    Hi!
    I use the normal WP login with a page reloading. I would like to show my logged users which menu items are new and available yet after login.
    These menu items are only for members and I would like to make another color for it.
    In my case the menu looks item looks like:

    <li class="menu-item-1279 menu-item menu-item-type-post_type menu-item-object-page">

    I would like to add a new css class for the item which is visible only after login.

    Plugin Author Daniel Iser

    (@danieliser)

    @softteam – Gotcha. That said since we remove items from the menu when the current user doesn’t meet the requirements, simply add the class via the existing class field in the menu editor. If you don’t see that field click “Screen Options” in the top right of the page and enable the “CSS Classes” checkbox.

    Hope that helps.

    • This reply was modified 7 years, 5 months ago by Daniel Iser.
    Thread Starter softteam

    (@softteam)

    Thank you, I will do it in this way ??

    Plugin Author Daniel Iser

    (@danieliser)

    @softteam – Awesome, be sure to take a moment to rate and review the plugin :).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add a CSS-class for menu item after login?’ is closed to new replies.