That is possible, but not because of the links themselves.
Instead, you’d just put in the links inside the relevant shortcode. See s2Member -> API/Scripting -> Custom Capabilities
Thread Starter
Yolle
(@yolle)
Great, thanks! I’ll have a look.
Thread Starter
Yolle
(@yolle)
Hi again!
I kind of got it to work using this code
[s2If current_user_can(access_s2member_level1)]
Some premium content for all Level 1 Members.
[_s2If current_user_can(access_s2member_ccap_music)]
Display links for music as well.
[/_s2If]
[_s2If current_user_can(access_s2member_ccap_videos)]
Display videos as well.
[/_s2If]
[_s2If current_user_can(access_s2member_ccap_xxx)]
Display xxx as well.
[/_s2If]
[_s2If current_user_can(access_s2member_ccap_yyy)]
Display yyy as well.
[/_s2If]
[/s2If]
The problem is, that I end up with many blank lines, when the s2member doesn’t have the specific ccap… Is there a way not to show blank lines?
Thank you very much!
First, if the post or page is already protected at level 1, you don’t need the very first shortcode (and therefore not the last either).
Getting rid of the blank lines depends on how your site is set up — I think it’s something to do with WordPress’s autop function –but is usually just a matter of deleting the blank lines in your code, or of putting shortcodes and text on the same line, like this:
[_s2If current_user_can(access_s2member_ccap_music)]Display links for music as well.[/_s2If]
[_s2If current_user_can(access_s2member_ccap_videos)] ...
You might need to play around with it a little bit, but then you’ll see what works for your site.
Thread Starter
Yolle
(@yolle)
Hi!
I managed to solve it with by putting all the code into one line and then adding <p> before every [/_s2If]
Thanks!