PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

open preview of protected content

s2Member Plugin. A Membership plugin for WordPress®.

open preview of protected content

Postby raymasa » August 21st, 2011, 12:50 pm

Hi all,

Started trying s2member few days ago. Really like, great plugin.

Is there a feature that would allow me to publicly show part of a page, but protect the rest? As a teaser to get people to become member of the site to view rest of the page. For example, if there are five paragraphs on the page, the first paragraph is visible to everyone (even when not logged in). if they like that and want to read the rest, they would need top register.

Is that possible to do with s2member?

Thanks,

Ray
User avatar
raymasa
Registered User
Registered User
 
Posts: 2
Joined: August 21, 2011

Re: open preview of protected content

Postby Bruce C » August 21st, 2011, 1:52 pm

Yup, you could protect the part of the page you don't want publicly visible with conditionals (Dashboard -> s2Member -> API/Scripting -> Simple/Shortcode Conditionals). Then, have a button show if they are not a member, using the [s2If !is_user_logged_in()] shortcode.

So your code could look something like this:
Code: Select all
This part is for the non-logged in users/users of a low level
[s2If !is_user_logged_in()]
...
If you would like to read more, please buy a membership here: http://example.com
[/s2If]
[s2If is_user_logged_in()]
The rest of the page.
[/s2If]


Hope that helps!
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: open preview of protected content

Postby Cristián Lávaque » August 22nd, 2011, 9:49 pm

Ace is correct.

Another approach, if you only need the teasers in the posts list (like the home page), would be to leave Alternative Views unprotected and use the <!--more--> where you want the preview to end, then when they click to open the protected post, they'll get sent to the Membership Options Page. WP Admin -> s2Member -> Restriction Options -> Alternative View Protection
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: open preview of protected content

Postby raymasa » August 24th, 2011, 8:47 pm

Thank you Ace of Spades and Cristián Lávaque. I have tried both solutions and they work. The more I am playing with this plugin, the more I like it.

While they both work, I really like the api method, very elegant.

Thanks again for your help.

Ray
User avatar
raymasa
Registered User
Registered User
 
Posts: 2
Joined: August 21, 2011

Re: open preview of protected content

Postby Cristián Lávaque » August 25th, 2011, 3:04 am

Thanks for the kudos! I'm glad that worked for you. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron