latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Restricting Access to Full Menus

Home Forums Community Forum Restricting Access to Full Menus

This topic contains 3 replies, has 2 voices. Last updated by  Raam Dev 4 years, 6 months ago.

Topic Author Topic
Posted: Monday Jul 2nd, 2012 at 11:51 pm #18123

Hey

Is there a way to hide the menu options in the drop down by access level? So say i have a training menu
with items “Free Training” “Paid Training” Is there a way to hide the “Paid Training” menu item?

Thanks
Ricky

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Tuesday Jul 3rd, 2012 at 7:27 am #18175
Raam Dev
Username: Raam
Staff Member

Hi Richard,

Yes, this can be done using the s2Member Advanced PHP Conditionals (see Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals).

You’ll need to edit your WordPress theme file where the menu is generated (probably the header.php file) and insert the code in there. For example:

<?php if (current_user_is("s2member_level4")){ ?>
    Code to display menu for Level 4 Members goes here
<?php } else if (current_user_is("s2member_level3")){ ?>
    Code to display menu for Level 3 Members goes here
<?php } else if (current_user_is("s2member_level2")){ ?>
    Code to display menu for Level 2 Members goes here
<?php } else if (current_user_is("s2member_level1")){ ?>
    Code to display menu for Level 1 Members goes here
<?php } else if (current_user_is("s2member_level0")){ ?>
    Code to display menu for Level 0 Members (i.e., free subscribers) goes here
<?php } else { ?>
    Code to display menu for non-members (i.e., users who are not logged in) goes here
<?php } ?>
Posted: Tuesday Jul 3rd, 2012 at 12:18 pm #18195

Awesome dude! Thanks!

Posted: Wednesday Jul 4th, 2012 at 8:27 am #18284
Raam Dev
Username: Raam
Staff Member

Glad I could help! :)

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

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.