Overview with latest edited posts and pages

You can use the $WPDB query to query the DB, an example would be:

$editedposts = $wpdb->get_results( 
"
 SELECT ID, post_title 
 FROM $wpdb->posts
 WHERE post_modified = between DateAdd(DD,-7,GETDATE() ) and GETDATE()
"
);

This lists all posts which have been edited in the last 7 days (not tested), you would do something similar to get posts created in that date:

$newposts = $wpdb->get_results( 
"
 SELECT ID, post_title 
 FROM $wpdb->posts
 WHERE post_date = between DateAdd(DD,-7,GETDATE() ) and GETDATE()
"
);

You can then query the data using the variable e.g.

foreach ( $editedposts as $newposts ) {
 echo $newposts->post_title;
}

Leave a Comment