add_filter('the_title', 'add_id_to_title', 10, 2); function add_id_to_title($title, $post_id) { //use the id to check the post type and only add the id if it has a type of "post" if(get_post_type($post_id) == "post") $title = $post_id.': '.$title; return $title; }