Viewing 15 replies - 16 through 30 (of 30 total)
  • Hi Jan,

    Has the solution above not worked for you?

    Tried it, the errors are gone.

    But this means editing in an original source file. For now the error are gone, but the issue is still open and to be solved. ??

    Thanks for the code.

    No probs. Thanks.
    Just wanted to know if it worked for anyone else.
    I’m sure by the next update they will have fixed the bug.
    Cheerio!

    Hey Roaning Elepants…

    Does the trailing “}” in your code, replace the one that wasn’t included in the original code?

    In your original code, it doesnt show the trailing “}”, but has it in the actual code, which you include in the replacement code.

    Did I make any sense? lol

    Meaning replace this original code:

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

    With this replacement:

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

    Hi Jayo,

    No, the trailing “}” is to close the opening “{” which was added at the end of first line. If you have a closer look at the original code, you’ll observe that there is no “{” or “}”. I’ve introduced a new line within the “if” statement and thought I should wrap it within curly brackets.

    In your post, what you’ve quoted as the “original code” is not the original code. The original code does not have the trailing “}”.

    Hope that makes sense?

    Ok sorry, I get what you’re saying. Didn’t noticed the opening “{” that was added.

    @roaming_elephants your code does work, thanks and cheers!

    Another tip is to disable then enable sitemaps. Especially after an upgrade. I haven’t changed any code from 1.4.10. Works fine for me.

    Pedro

    (@petredobrescu)

    @roaming_elephants thanks for the fix, it works like a charm!

    I had the secondary error:

    An invalid date was found. Please fix the date or formatting before resubmitting.

    Thanks again!

    Anyone know if the developers are on this?

    Yoast will probably fix it in the next release. I’m not sure it is really causing problems with google as it seems to be processing the child xml maps ok but I won’t know until next full crawl.

    I made the edit and it worked for me.

    M

    (@infolegal)

    Jayo, same problem with date here too. Applied your fix now and waiting for Google Webmasters to update the sitemap. If it does work (which I expect) you should send the fix to Yoast plugin developer.

    Thanks for looking into this.

    Fixed in version 1.4.11

    Nice ??

    Thanks.

Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] XML sitemap with wrong date format’ is closed to new replies.