• Hi,
    I have had a good look through the forums and the Wiki, but can’t find exactly what I am looking for.
    Has anyone seen a plugin that allows for showing the latest posts that have been updated?
    Thanks for any advice 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • By updated, I assume you mean edited?
    Ok, just for fun, I decided to see if I could do this. On one of my sites, I have been using a Recent Posts hack. So I modified it to pull posts where the post_date < post_modified. At first I got an error but then I edited a post (in case there were none for it to pull!) and it seems to work. See here: http://moltenwords.net/pp101/ It says Recent Posts, but I didn’t change that.
    Here is the code I used:
    <?php
    function get_edited_posts($no_posts = 5, $before = '

    • ', $after = '
    • ', $show_pass_post = false, $skip_posts = 0) {
      global $wpdb, $tableposts;
      $request = "SELECT ID, post_title FROM $tableposts WHERE post_date < post_modified ";
      if(!$show_pass_post) { $request .= "AND post_password ='' "; }
      $request .= "ORDER BY post_date DESC LIMIT $skip_posts, $no_posts";
      $posts = $wpdb->get_results($request);
      $output = '';
      foreach ($posts as $post) {
      $post_title = stripslashes($post->post_title);
      $permalink = get_permalink($post->ID);
      $output .= $before . '' . $post_title . '' . $after;
      }
      echo $output;
      }
      ?>
      It would go in your my-hacks file, then on the index.php you would need to include <?php get_edited_posts(); ?> where you want them to be.
      This is my first attempt at modifying anything like this, so I make no guarantees. 🙂

    Thread Starter shadow

    (@shadow)

    Thanks Oriecat:)
    I will have a play with it later today and see how it goes.

    Another recently modified hack. 😉

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Posts updated’ is closed to new replies.