Last Modified Posts in WordPress

Want to show the last posts you updated in WordPress? This shows the posts you went back and updated or modified, which is different than your recent posts.


<?php
query_posts('showposts=10&orderby=modified&order=DESC');
if (have_posts())
{
echo '<h3>Last Modified Posts</h3>';
echo '<ul>' . "\n";
while (have_posts()) : the_post();
echo '<li>';
echo '<a href="' . get_permalink() . '">' . the_title('','', false) . '</a>';
echo '</li>' . "\n";
endwhile;
echo '</ul>';
}
?>

Tags: ,

Comments -49-0 of 3 to “Last Modified Posts in WordPress”

  1. -49 · bowlesonline says:

    Is this available as a plugin? I want the default sort order of my blog to be “last modified.”

  2. -48 · blogger says:

    I wrote this as something to throw in your sidebar. I haven’t studied the WordPress Plugin API so I normally just do snippets of code or hacks.

  3. -47 · Henrietta says:

    Very good post! Thank you for the work done!

Leave a Comment

Comments are reviewed before publishing to prevent spam.