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™

Restricting posts in category when each post is 7 days old

s2Member Plugin. A Membership plugin for WordPress®.

Restricting posts in category when each post is 7 days old

Postby ahammer » October 11th, 2011, 10:55 pm

Is there a way to restrict a post to a higher member level after the post is x days old? Our site offers a free tip of the week to all users. The following week, when a tip is replaced by the new tip for the current week, the previous tip needs to move to a member's only archive. Could we automatically restrict the access to a member level 1 after 7 days?

Thanks,
Andrew
User avatar
ahammer
Registered User
Registered User
 
Posts: 3
Joined: October 11, 2011

Re: Restricting posts in category when each post is 7 days o

Postby Eduan » October 12th, 2011, 7:05 am

Hi ahammer,
maybe this post could help: viewtopic.php?f=4&t=15140.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Restricting posts in category when each post is 7 days o

Postby Cristián Lávaque » October 12th, 2011, 7:39 pm

Eduan is correct. You can use conditionals and the content dripping as explained in the documentation. WP Admin -> s2Member -> API / Scripting -> Advanced/PHP Conditionals and s2Member Content Dripping

Code: Select all
<?php if (current_user_can('access_s2member_level2') || S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < 7) { ?>
The tip.
<?php } else { ?>
No tip.
<?php } ?>



I hope this helps. :)
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: Restricting posts in category when each post is 7 days o

Postby ahammer » October 12th, 2011, 7:51 pm

Yes, both posts are somewhat helpful. However, the memberships will not be purchased so we won't have that date. Can the logic be adapted to work based on the post date? We are using posts to hold each tip of the week so would need to use post date+7 as the lock for the content.

Thanks,
Andrew
User avatar
ahammer
Registered User
Registered User
 
Posts: 3
Joined: October 11, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron