This topic has 7 replies, 4 voices, and was last updated 10 years by Abe.

  • Author
  • #7164
     mpitka
    Participant

    Hi!

    I want to hide top menu from everyone else but Pmpro members with ID4.

    This worked with custom CSS with not logged in users, but I don’t know how to modify it.

    body:not(.logged-in) .top-bar {display:none;}

    Can someone help?

    #7246
     SQadmin
    Keymaster

    Hi, You can’t do it with CSS. You have to edit sweetdate/header.php and find the menu function: wp_nav_menu( … );
    and change it to if ( pmpro_hasMembershipLevel(array(1,2,3))) { wp_nav_menu( … ); }

    You will need basic PHP knowledge

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #7252
     mpitka
    Participant

    Thank you for your help!

    Is it possible to give a little bit more detailed instructions, because I don’t have good PHP knowledge.

    #7255
     Anchora
    Participant

    it was well explained, wasnt it? 😀

    Hi, You can’t do it with CSS. You have to edit sweetdate/header.php and find the menu function: wp_nav_menu( … );
    and change it to if ( pmpro_hasMembershipLevel(array(1,2,3))) { wp_nav_menu( … ); }

    …find header.php…
    …find wp_nav_menu…
    …change it….
    😉

    #7256
     mpitka
    Participant

    heh, You’re right. I don’t know what I messed up. For everybody else, who’s so noob, the whole working code is:

    <?php if ( pmpro_hasMembershipLevel(array(1,2,3))) { wp_nav_menu( array( ‘container’ => false, ‘menu_class’ => ‘left’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ‘sweetdate_main_nav’, ‘walker’ => new sweetdate_walker_nav_menu) ); } ?>

    Thank you!

    #8053
     mpitka
    Participant

    New problem arrived.

    This code you gave me previously. It worked fine with older version of theme. Now it will disable menu for ALL users. Any ideas? 🙂

    #8067
     mpitka
    Participant

    it works. Typo.

    #8113
     Abe
    Keymaster

    Great 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?