latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

PHP Conditional for Specific Post/Pages

Home Forums Community Forum PHP Conditional for Specific Post/Pages

This topic contains 3 replies, has 2 voices. Last updated by  Cristián Lávaque 4 years, 2 months ago.

Topic Author Topic
Posted: Thursday Oct 11th, 2012 at 8:01 pm #28179
Jamey Turcic
Username: jlt1267

My apologies up front if this question has already been answered, but rest assured I did search first. :)

We just started using S2Member and getting it integrated into our site. We’re really interested in being able to sell content both as a membership service where members get access to all site content, however we also want to sell content on a per post/page basis (ala carte). In a vast majority of the cases those posts will be one and the same.

I understand how to use ccap to create membership levels and grant access to posts via PHP conditionals via the conditionals that S2 provides for ccap. However, I don’t see a similar conditional provided for Specific Posts/Pages. Is it possible to use the PHP “OR” operator to evaluate two conditions for which S2Member will allow access to a post/page?

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Friday Oct 12th, 2012 at 6:54 am #28205

Hi Jamey.

No, Specific Post/Pages can only be accessed by the admin or someone with a URL generated by s2Member to access it. Conditionals don’t work for it, because the page’s content is not even loaded if the person didn’t use the special URL for it.

I haven’t tried this, but maybe you can create a hack that checks whatever your conditions are, and if he meets the one other than the Spec Post/Page restriction, then bypass the restriction.

I hope that helps. :)

Posted: Monday Oct 15th, 2012 at 2:47 pm #28458
Jamey Turcic
Username: jlt1267

Thanks Christian. I’ll take the obvious next question to the Community forum. :)

Posted: Tuesday Oct 16th, 2012 at 10:48 am #28562

You’re welcome. :)

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.