Wordpress PHP Finish Up- Recently Updated Posts

by 6 replies
7
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/
#programming #finish #php #posts #recently #updated #wordpress
  • You could just use the recent post widget assuming your theme supports widgets.
    • [1] reply
    • 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.

  • What do you want, just links and date modified?
    • [2] replies
    • the Warrior editor fudged my code and there is no delete button....
    • 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;
      • [ 1 ] Thanks
      • [1] reply

Next Topics on Trending Feed

  • 7

    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!