Advertisement
Guest User

Untitled

a guest
Jul 10th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2.  
  3. $today = current_time('mysql', 1);
  4. $number = 5; // number of posts
  5.  
  6. if($recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_modified_gmt < '$today' ORDER BY post_modified_gmt DESC LIMIT $number")):
  7.  
  8. ?>
  9.  
  10. <h2><?php _e('Recently Updated'); ?></h2>
  11. <ul>
  12. <?php
  13.  
  14. foreach($recentposts as $post) {
  15.  
  16. if($post->post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID);
  17. echo '<li><a href="'.get_permalink($post->ID).'">'.the_title().'</a></li>';
  18.  
  19. } ?>
  20. </ul>
  21.  
  22. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement