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.

Display a menu only for Level 0 users.

Home Forums Community Forum Display a menu only for Level 0 users.

This topic contains 3 replies, has 3 voices. Last updated by  Bruce 4 years ago.

Topic Author Topic
Posted: Friday Dec 21st, 2012 at 9:04 pm #35295

Hello,

I want to add a menu to my navigation bar that only appears when a user is logged in, and they are level 0 (open registration).

I tried to make a menu in wordpress via Appearance > Menus and then in the Navigation Label section I was going to wrap the menu in a short code, like this : [s2If current_user_is(s2member_level0)]My Menu For Level 0 Users[/s2If]

But it does not work and just shows all the shortcode along with the menu.

Since that didn’t work is there any simple way to do this?

Thanks,
Ben

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Saturday Dec 22nd, 2012 at 3:10 pm #35350
Eduan
Username: Eduan
Moderator

Hello Benjamin,

Shortcodes don’t work inside code, that’s why it doesn’t work. You will need to use the PHP version of these conditionals, check under Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals for more info.

Hope this helps. :)

Posted: Saturday Dec 22nd, 2012 at 3:20 pm #35351

Thanks for the help.

I just tried this inside the navigation label under Appearance > Menus:

<?php if (current_user_is("s2member_level0")){ ?>Menu for only level 0 users<?php } ?>

But it displayed the menu for everyone. Not just level 0. Can you please show me what I’m doing wrong?

Posted: Sunday Dec 23rd, 2012 at 3:07 am #35406
Bruce
Username: Bruce
Staff Member

Hi Bejamin,

You’ll need to edit your theme to change when navigation bars are shown. s2Member currently does not natively support restricting access to navigation bars. If you’re not comfortable working with the code in your theme, we suggest posting a job on Elance.com or jobs.wordpress.net.

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.