Display who modify your post(s)!
You can display who modarate/modify your post. This mean show the latest author who modified your post. We can use 2.8′s new template tag ‘the_modified_author()‘. If you use Wp 2.8 you can use a simple code but, if you use Wp 2.7 you have to use this function below. Lets Begin :)
Here is the code;
With this function we will change our templates funcitons.php. If you don’t know about WordPress or PHp coding, please don’t touch this file. If you any questions about that, contact me :)
Firstly you shuold make a backup of functions.php (path: wp-contect/themes/your-theme/funcitons.php). After copy this code to end of file:
if (!function_exists('get_the_modified_author')) {
function get_the_modified_author() {
global $post;
if ( $last_id = get_post_meta($post->ID, '_edit_last', true) ) {
$last_user = get_userdata($last_id);
return apply_filters('the_modified_author', $last_user->display_name);
}
}
}
if (!function_exists('the_modified_author')) {
function the_modified_author() {
echo get_the_modified_author();
}
}
After that you can save and upload this to your web server. Than you can use this code anywhere (single.php, index.php etc.):
<?php the_modified_author(); ?>
That’s All! Have a nice day!
