Community Support Forums — WordPress® ( Users Helping Users ) — 2011-05-11T20:43:32-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=6385 2011-05-11T20:43:32-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6385&p=14667#p14667 <![CDATA[Re: restrict only older posts - based on age]]>
Code:
<?php // Paid member or post newer than 30 days: show.
if (current_user_can('access_s2member_level1') || (time() - get_the_time('U')) < 2592000) { ?>
    
    Here goes the post...

<?php } ?>


Of course you'd need to customize it further to present something different for those that can't see the post.

If you don't know enough PHP to achieve the customization you want, I suggest you get a freelance developer to help you at a place like jobs.wordpress.net, take a look here viewforum.php?f=37

I hope that helps. :)

Statistics: Posted by Cristián Lávaque — May 11th, 2011, 8:43 pm


]]>
2011-05-11T17:34:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6385&p=14649#p14649 <![CDATA[Re: restrict only older posts - based on age]]> well :o
I am in no way well versed in PHP. this seems quite complicated.

Isn't there a simple way to do it?
Maybe it can be added to a future version. I guess its not a too obscure feature, probably many people will use it.

Or maybe you can give the right snippet of code.

Thanks anyway

Statistics: Posted by arthomas — May 11th, 2011, 5:34 pm


]]>
2011-05-11T17:24:03-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6385&p=14648#p14648 <![CDATA[Re: restrict only older posts - based on age]]>

Well, you could use s2Member conditionals to check that the user is a paid member and check the time the post was published too, and show it based on that.

WP Admin -> s2Member -> API / Scripting
http://www.s2member.com/api-scripting-overview-video/
http://www.s2member.com/advanced-conditionals-video/
https://codex.wordpress.org/Template_Tags#Post_tags

Statistics: Posted by Cristián Lávaque — May 11th, 2011, 5:24 pm


]]>
2011-05-11T16:59:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6385&p=14647#p14647 <![CDATA[restrict only older posts - based on age]]>
Is it possible to restrict posts based on age?

Case:
I want to offer news to everybody, but archives only to paid members, archives would be considered all posts older than 3 weeks or a month.
I think some newspapers have this model.

Is it currently possible? its not any particular date, just 3 weeks from today, or so.

I think its a very simple and interesting way to get people to pay while keeping your general readership happy.

Statistics: Posted by arthomas — May 11th, 2011, 4:59 pm


]]>