Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $today = current_time('mysql', 1);
- $number = 5; // number of posts
- 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")):
- ?>
- <h2><?php _e('Recently Updated'); ?></h2>
- <ul>
- <?php
- foreach($recentposts as $post) {
- if($post->post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID);
- echo '<li><a href="'.get_permalink($post->ID).'">'.the_title().'</a></li>';
- } ?>
- </ul>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement