Hi ftfarhad.
Below simple function will help you on the same.
<?php
$today = current_time('mysql', 1);
$count = 5;
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 $count")):
?>
<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>ID)."'>";
the_title();
echo '</a></li>
';
}
?>
</ul>
<?php endif; ?>
let me know if you need more help 🙂
Where I use this code? in the loop or functions.php?
Wherever you want display latest updated posts. just paste this code there
Thanks. If any one comment a post which was created 1 year ago, then it will show in homepage?