Page 1 of 1

Using Advanced Conditionals

PostPosted: May 7th, 2010, 2:00 pm
by PerryM
Hi, love this plug-in!

Trying to have a Membership Options Page that, when viewed by a member, shows upgrade buttons to higher level members. I'm having little luck here. I've tried to take a WP Page and use the "HTML" code button in the TinyMCE editor and inserted the following:

Code: Select all
<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 2){ ?>
    Some content for Members who are logged in with an s2Member Level >= 2.
<?php } else { ?>
    Some public content.
<?php } ?>


But the visual page returned destroys the above code. I do have Exec-PHP installed and it works just fine.

I want members greater or equal to level 2 to see certain things and members below that to see something else.

Any help would be appreciated.

Re: Using Advanced Conditionals

PostPosted: May 12th, 2010, 7:37 pm
by Elizabeth
Thank you, we appreciate the feedback.
Here are some things I would try:
  • Try not switching back and forth between the Visual and HTML editor, while writing code.
  • Go to Settings-> Writing -> Fix Invalid XTHML, and make sure it's unchecked. That box is reported to cause problem with Exec PHP.
  • If all else fails, try disabling the Visual Editor completely from your Profile panel. I recommend doing this in general. The visual editor is not compatible with writing PHP code.
Good luck.