WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a way to list posts being viewed but I can't find anything online.

Is it even possible? I've seen some websites that have these loops, "What other readers are currently reading".

I'm using the following loop to list random set of videos

      if ( is_home() ){
      $cat = get_query_var( 'cat' );
      query_posts(array('orderby' => 'rand', 'showposts' => 10, 'cat'=>$cat));
      while (have_posts()) : the_post();

How can I show posts being viewed? anyone

share|improve this question
up vote 1 down vote accepted

I would suggest a way to implement this to be in the post template have a call that updates post meta with the current timestamp. Then you can show posts that have been viewed recently by querying meta data for all values within a certain time range ordered by that timestamp.

share|improve this answer
Is it possible to tell wordpress to update the timestamp value if a post has been accessed? – Jose David Garcia Llanos Feb 22 '13 at 10:53
Yes, I would store that in post meta and, as the answer states, I would suggest using a post template to update that post meta. – Steve Buzonas Jan 12 at 9:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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