Page 1 of 1

How to partially protect posts

PostPosted: May 25th, 2011, 4:47 am
by irtimood
Hello again :D

I have another setup problem: i'd like to make every protected post readable for the first 30 words and then show an invitation to signup just like "to read the entire article please join one of our plans".

In this way i can mantain the indicization on search engines of theese pages....

Re: How to partially protect posts

PostPosted: May 25th, 2011, 4:49 pm
by Cristián Lávaque
Oh, that's a great model, and you can certainly achieve it with s2Member's simple conditionals (using WP shortcode). Here's the documentation for that WP Admin -> s2Member -> API / Scripting -> Using Simple Conditionals.

Re: How to partially protect posts

PostPosted: May 30th, 2011, 10:10 am
by hapke
Could you please give an example?
[insider]protected content[/insider]
Will that work?

Re: How to partially protect posts

PostPosted: May 30th, 2011, 1:12 pm
by Cristián Lávaque
It's documented where I pointed him to, but here's an example.

Code: Select all
My first 30 words...

[s2If current_user_can(access_s2member_level1)]
The rest of my post...
[/s2If]

[s2If !current_user_can(access_s2member_level1)]
Ask him to purchase access.
[/s2If]
* The ! before the condition means "not".

I hope that helps. :)

Re: How to partially protect posts

PostPosted: May 30th, 2011, 1:43 pm
by hapke
:)