0

Is there any function or a way to access the time of last visit to a post by a visitor?

1 Answer 1

1

You can put a small script in your single.php that updates a custom field with the current time.

update_post_meta(get_the_ID(),"last_visit",time());
1
  • 1
    Of course, that will update when anyone views it, so you could simply end up logging the last time you viewed the content yourself. Google/other-searches would likely also count.
    – t31os
    Commented Aug 18, 2013 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.