Page 1 of 1

Show hyperlink to members only

PostPosted: July 7th, 2010, 8:56 pm
by alberto
I am trying to find out if your plugin will be useful for me

Want to show hyperlink to members only while keep only text for guests

For example:

[guests see] Link 1 - Link 2 - Link 3 - Link 4
[members see] Link 1 - Link 2 - Link 3 - Link 4

Thank you for your time.

Re: Show hyperlink to members only

PostPosted: July 8th, 2010, 5:05 am
by Jason Caldwell
Hi there. Thanks for your inquiry.

Yes, you can use s2Member to accomplish this.
You'll want to use s2Member's Advanced Conditionals.

Here is a quick example:
Code: Select all
<?php if(is_user_logged_in()){ ?>

    <a href="#">Link 1</a> - <a href="#">Link 2</a>

<?php } else { ?>

    Link 1 - Link 2

<?php } ?>
For further details, please install the s2Member plugin. Then, from your WP Dashboard, go to: s2Member -> API Scripting -> Advanced Conditionals. There are additional examples there.

Another example:
Code: Select all
<?php if(is_user_logged_in() && current_user_can("access_s2member_level1")){ ?>

    <a href="#">Link 1</a> - <a href="#">Link 2</a>

<?php } else { ?>

    Link 1 - Link 2

<?php } ?>

Re: Show hyperlink to members only

PostPosted: July 17th, 2010, 2:16 pm
by alberto
Thank you for your help. I am still evaluating and trying to figure out how everything works.

Re: Show hyperlink to members only

PostPosted: July 18th, 2010, 2:33 am
by Jason Caldwell
~Very welcome. Thanks for the followup.