Quantcast
Channel: WordPress.org Forums » [Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Support
Viewing all articles
Browse latest Browse all 42467

roaming_elephants on "[Plugin: WordPress SEO by Yoast] XML sitemap with wrong date format"

$
0
0

Without knowing much about php, I think I have managed to narrow down the problem to date format with custom taxonomies.

To sort out the issue (which worked for me), the following lines should be edited in wordpress-seo/inc/class-sitemaps.php file:

Line 249 and 250, which currently read:

if ( $query->have_posts() )
	$date = $query->posts[0]->post_modified_gmt;

Should be changed to:

if ( $query->have_posts() ) {
  $date = $query->posts[0]->post_modified_gmt;
  $date = date( 'c', strtotime( $date ));
}

This puts the date in correct format. As I said, it worked for me.
Bare in mind that I am not a programmer, but just a man with a lot of persistence. I'm not sure how the above edit affects the rest of the file - it shouldn't affect it adversely.

Good luck!

http://atifabusamra.com


Viewing all articles
Browse latest Browse all 42467

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>