Wordpress PHP Finish Up- Recently Updated Posts

6 replies
I am trying to have a column of recently updated posts on my Wordpress website. So far here is what I have (found form the web) for doing just that. I can't get the coding to work though and any help would be appreciated.

Alternatively, if there is a plugin I missed point it out and I will give you many thanks!

PHP Code:
< ?php
 = current_time('mysql', 1);
if (  = ("SELECT ID, post_title FROM  WHERE post_status = 'publish' AND post_modified_gmt < '' ORDER BY post_modified_gmt DESC LIMIT 18")):
?>
<h2>< ?php _e("Recent Posts"); ?></h2>
<ul>
<?php
foreach ( as ) {
if ( == 
'')  = sprintf(__('Post #%s'), );
echo 
"<li><a href='".get_permalink()."'>";
the_title();
echo 
'</a></li>';
}
?>
</ul>
< ?php endif; ?>
Is there an updated version of this plugin anywhere: http://wordpress.org/extend/plugins/...updated-posts/
#finish #php #posts #recently #updated #wordpress
  • Profile picture of the author phpbbxpert
    You could just use the recent post widget assuming your theme supports widgets.
    {{ DiscussionBoard.errors[2559085].message }}
    • Profile picture of the author allthesp
      I have two columns on my website. The first displays the recently added posts, which I use the recent post function for. The second column I want to display recently updated, rather than recently created, posts.

      Hope that clears up any misunderstandings.

      Originally Posted by phpbbxpert View Post

      You could just use the recent post widget assuming your theme supports widgets.
      Signature
      {{ DiscussionBoard.errors[2559102].message }}
  • Profile picture of the author phpbbxpert
    What do you want, just links and date modified?
    {{ DiscussionBoard.errors[2559545].message }}
    • Profile picture of the author phpbbxpert
      the Warrior editor fudged my code and there is no delete button....
      {{ DiscussionBoard.errors[2559568].message }}
    • Profile picture of the author phpbbxpert
      Here, I wrote this quick, but I think it should work, I tested it a little bit.

      EDIT the post editor cuts up code here,
      moved it to a paste
      PHP | function latest_updates($limit - Latest updates - dWcNJ0vH - Pastebin.com

      Use it just by calling the function
      latest_updates();

      You can add a number for the limit
      latest_updates(10);

      Default is 5

      If you don't want the content and just the link and update date
      comment out
      $output .= $post->post_content;

      Like
      //$output .= $post->post_content;
      {{ DiscussionBoard.errors[2559574].message }}
      • Profile picture of the author allthesp
        I will try that out tomorrow. Thanks a lot!
        Signature
        {{ DiscussionBoard.errors[2559654].message }}

Trending Topics