• Hello,
    First of all, great job on an excellent plugin!

    I’ve recently installed it on a website that relies heavily on custom post types. After setup and checking the sitemap.xml, I’ve found that the plugin doesn’t submit my custom post types, in order for it to work I have altered sitemap-core.php line 1169 from

    function GetCustomPostTypes() {
    		$post_types = get_post_types(array("public"=>1));
    
    		$post_types = array_diff($post_types,array("post","page","attachment"));
    		return $post_types;
    	}

    to

    function GetCustomPostTypes() {
    		$post_types = get_post_types();
    		return $post_types;
    	}

    after doing so, it displayed all post types (as you would expect having removed array_diff from the function). The resulting list was “Include custom post type Posts” repeated for each post type, as opposed to the actual post type name e.g. post_type_gallery.

    In order to fix this, I have changed line 1088:

    <?php echo str_replace('%s',$post_type_object->label,__('Include custom post type %s', 'sitemap')); ?>

    to

    <?php echo str_replace('%s',$post_type_object->name,__('Include custom post type %s', 'sitemap')); ?>

    As I want to continue using the plugin and update it, would it be possible to update this feature of the plugin please?

    Thanks
    Tez

    https://www.ads-software.com/extend/plugins/google-sitemap-generator/

  • The topic ‘[Plugin: Google XML Sitemaps] Feature/Fix: Custom Post Types’ is closed to new replies.