I thought something like this would work, unfortunately he didn't :(
function add_sitemap_custom_items(){
$postsForSitemap = get_posts(array(
'numberposts' => -1,
'orderby' => 'modified',
'post_type' => array('job_listing'),
'post_status' => array('expired'),
'order' => 'DESC'
));
$sitemap_custom_items = '<sitemap>';
foreach($postsForSitemap as $post) {
$sitemap_custom_items .= '
<url><loc>'. get_permalink($post->ID) .'</loc>
<lastmod>'. $postdate[0] .'</lastmod></url>
';
}
$sitemap_custom_items .= '</sitemap>';
return $sitemap_custom_items;
}
add_filter( 'wpseo_sitemap_index', 'add_sitemap_custom_items' );