how to show content only for first 3 days in wordpress?

Discussion in 'Programming' started by haliloo22, Oct 6, 2013.

  1. #1
    hello, can somebody please help me

    i want to post offers on my wordpress site but i want it showing the post each every next 3 days something differ like:

    when i make a post:

    -first 3 days it must show the post/content = people see what i have written in my post
    -after 3 days it will say sorry you cant see this content anymore : the post must not be deleted, people can only not see the content

    how can i show <?php the_content(); ?> only first 3 days? and after 3 days saying sorry this content is locked up

    also is it possible to let people see the content after 10th day? another code?
     
    haliloo22, Oct 6, 2013 IP
  2. competent123

    competent123 Notable Member

    Messages:
    1,752
    Likes Received:
    71
    Best Answers:
    6
    Trophy Points:
    255
  3. nhed

    nhed Well-Known Member

    Messages:
    352
    Likes Received:
    31
    Best Answers:
    1
    Trophy Points:
    130
    #3
    nhed, Oct 6, 2013 IP
  4. haliloo22

    haliloo22 Member

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    but i am posting 100 posts a day, do i need to do that for each post? can it just not automatically do for all posts automatically please anyone?
     
    haliloo22, Oct 6, 2013 IP
  5. pictureboarduk

    pictureboarduk Well-Known Member

    Messages:
    551
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    140
    #5
    Yes you can run a Cron job and once the DATETIME is > three days your script can update the database to set the posts to hidden or whatever state you want them to be in. It would be pretty easy to do in Wordpress. You might like to however add some form of redirection though incase Google etc has indexed those pages, be a shame to 404 your visitors.
     
    pictureboarduk, Oct 7, 2013 IP