Created
February 16, 2015 13:27
-
-
Save setuix/a3258f6db212152f73de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$today = current_time('mysql', 1); | |
$howMany = 5; //Number of posts you want to display | |
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 $howMany")): | |
?> | |
<h2><?php _e("Recent Updates"); ?></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(); | |
echo '</a></li>'; | |
} | |
?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment