Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #24305

    Hello,

    A simple thing seeming so hard to achieve. :(

    Does anyone know how and why ‘any’ plugins I try with Enfold to hide/restrict menu items ‘unless user is logged in’ are not working?

    For example: http://wordpress.org/plugins/menu-items-visibility-control/ won’t work and I’m sure it’s something to do because mega menus is being used by Enfold?

    I’m using WooCommerce plugin for WordPress also, considering your theme works along side of it.

    Cheers,

    Daniel

    #123087

    Hi Daniel,

    The one you linked uses conditional tags so make sure you are using correct syntax and code. You can try switching to one of the default wordpress themes and see if it works there as well.

    Regards,

    Devin

    #123088

    Hello Devin, yeah it works on the default WordPress themes. So that’s why I’m assuming mega menus is causing all ‘hide’ menu items from users not logged in to not work.

    Is there ‘any’ way for me to be able to ‘hide’ menu items (from users not logged in – Frontend) while using the Enfold theme? I’ve tried so many plugins and I’m exhausted for ideas as to go about it.

    I notice some of WooCommerce menu items are hidden when I’m not logged in, so some how they have achieved it with the Enfold theme and I assume this is because of some of the coding that Enfold developers have done.. if that makes sense?

    Cheers,

    Daniel

    #123090

    I’m not sure if there’s a working plugin out there but you can try to hide items with a custom class. Insert the class into the css class field (eg use “hide-item-not-login” (without “”))

    and insert following code into the quick css field

    .hide-item-not-login{
    display: none !important;
    }

    .logged-in .hide-item-not-login{
    display: block !important;
    }

    #123091

    Thanks Peter,

    That’s what I just found myself, that it’s achievable by CSS. I found the following way by inserting it into the header.php

    <!--    HIDES MENU ITEM IF THE USER IS NOT LOGGED IN   -->
    <?php if (is_user_logged_in()){
    echo "";}
    else {
    echo "<style type='text/css'>
    li.menu-item-1408 {display:none;}
    .social_header .phone-info.with_nav span { border-left-width: 0px; }
    </style>";
    };
    ?>

    Your’s works for sure and I’ll use yours. I was just hoping to remove it from the Source Code for SEO reasons, but I guess sometimes there is just to much rebuilding involved :) I’m going to learn PHP and MySQL better and hopefully this will aid me to achieve quick fixes and tweaks in my web design future.

    #123092

    Glad we could help :)

    Let us know if you have any other questions or issues.

    Regards,

    Devin

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Hide Menu Items’ is closed to new replies.