OddOneOut / bwp-google-xml-sitemaps

WordPress plugin that helps generate XML Sitemaps for your website/blog.
http://betterwp.net/wordpress-plugins/google-xml-sitemaps/
19 stars 11 forks source link

Enable Images for custom sitemaps #42

Open xberg opened 7 years ago

xberg commented 7 years ago

Hi, If I want to have the image tags appear in my custom sitemaps, I need to modify your xml.php file located: /wp-content/plugins/bwp-google-xml-sitemaps/src/sitemap/xml.php

and remove both conditions checking for: if ($this->provider->is_image_allowed())

Indeed, I did not find a way thru the admin panel to let the app know that I want images also on the custom sitemaps.

Once I remove the condition checking in xml.php it all works fine. But certainly there should be a way to do so without modifying your code.

thanks!

kminh commented 7 years ago

There are quite a few prerequisites before a sitemap can have image tags. Actually, the current image sitemaps are post sitemaps with thumbnail emails. For now I do not have the plan to support image tag for custom sitemap yet, but you can take a look at the following methods and find your way around instead of having to modify the plugin's codes: