force refresh (3 posts)

  1. lepenser
    Posted 5 years ago #

    Hello all,

    I have a website set up on wordpress. It runs on a computer in a gallery, available for all visitors to get more information. The main page, the home page, is the portal to everything. From there, you can get into specific sections (pages, not posts) and leave comments there.

    I need a way to force refresh from the pages to the home page, in the case that a person clicked on a specific page but registered no activity within X seconds. Let's say he started writing a comment, but he apparently stopped and left the computer. I'd like it to refresh back to the main page, for the other visitors of the gallery. How can that be achieved?

    If there's a way to pop up an alert, warning that person (just in case he's still there, just wandered off...), that would be sublime.

    Thank you in advance :)

  2. Xephan
    Posted 5 years ago #

    You'll have to use javascript, use javascript's setTimeout() to call a js function that changes the page location back to the main page after X seconds. You can have it do another setTimeout for a message that ask any possible visitor if they need more time, then if that also times out, do the redirect.

    All of this is Javascript, the only WordPress part would be to add the script to the header.

  3. lepenser
    Posted 5 years ago #

    Hi Xephan, thanks for your reply. Can you help me get started? I'm not a coder... :(

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.