WordPress.org

Ready to get started?Download WordPress

Forums

Multi Site Menu Problem (4 posts)

  1. matt solomon
    Member
    Posted 2 years ago #

    Hello,

    i am using wpms, and i am using thememylogin to manage my users.

    I have this code written which i use in the header of the theme.

    <?php if(current_user_can('level_10')) {
    echo "";}
    else {
    echo "<style type='text/css'>
    .menu-item-115 {display:none;}
    </style>";
    };
    ?>
    
    <!--    HIDES MENU ITEM IF THE USER IS NOT LOGGED IN   -->
    <?php if (is_user_logged_in()){
    echo "<style type='text/css'>
    .menu-item-112 {display:none;}
    .menu-item-109 {display:none;}
    .menu-item-108 {display:none;}
    </style>";}
    else {
    echo "<style type='text/css'>
    .menu-item-111 {display:none;}
    .menu-item-110 {display:none;}
    </style>";
    };
    ?>

    Now the problem is, that on a subsite, domain1.domain.com the menu order would be different, maybe menu item 111 is for a newsletter. ad so this menu item gets hidden?

    How can i assign the number or fix this?

    Thanks

  2. Joshua Parker
    Member
    Posted 2 years ago #

    To hid a certain page menu, you would need to grab the page's slug and do something like the following:

    if (is_user_logged_in() && is_page('newsletter'))

  3. matt solomon
    Member
    Posted 2 years ago #

    Sorry parker, this doesn't make sense/help me :/

    could you explain a bit further?

  4. That if is instead of the if you have in the first line of the code you pasted. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic