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.

Protected Content Based on Date Published

Home Forums Community Forum Protected Content Based on Date Published

This topic contains 2 replies, has 2 voices. Last updated by  behladesign 3 years, 9 months ago.

Topic Author Topic
Posted: Thursday Apr 4th, 2013 at 4:40 am #46565

I’m working with a newspaper and they’d like the member portion of the site to be restricted so that it shows the last 6 months of news. After 6 months the content would be free to anyone. Do you know of a way I can do this so that as content gets past 6 months initial publish date it would be no longer be restricted and available for anyone to see?

Content that is 6 month old of newer would be restricted to a single membership.

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Thursday Apr 4th, 2013 at 9:47 am #46608

Hmm… I’d probably try having a conditional in the template, checking the post’s time.

Maybe something like this:

[hilite pre_code]
get_post_time('U', true) < strtotime('-6 months') [/hilite] http://codex.wordpress.org/Function_Reference/get_the_time
http://php.net/strtotime

Posted: Thursday Apr 4th, 2013 at 5:55 pm #46634

That’s great, i’ll test it out!

Viewing 2 replies - 1 through 2 (of 2 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.