• Hi guys, I’m new here and I need your help. Can someone help me with the website I want to create. I need website where guests can register and after that they can post a message/image of the day. It will be a button on the homepage and when guest visit website and click on that button, they will see random message of the day only one time in 24h and can share that on their social media. Does someone know how I’m able to make something like that in WordPress? Thanks in advance

    • This topic was modified 4 years, 3 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    WP will do most of that as-is, using posts to contain the message/image. A bit of code in the page template the button leads to can deliver a random post. Only allowing a user to see the same message in 24 hours is the part that WP doesn’t do on its own. Adding it would be a matter of saving which post they got in a cookie that expires in 24 hours. If the cookie exists, serve them that post, otherwise get one at random.

    In using cookies, it does mean if a user used a different browser or device, they’d see a different message for the same day. If that’s not acceptable, you’d need to require login to keep track of what they were shown.

    It’d be a good idea to also keep a history of messages shown in the recent past to avoid repetition, though that means the message is not truly random.

Viewing 1 replies (of 1 total)
  • The topic ‘Message of the day’ is closed to new replies.