Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: date_i18n broken in latest 4.9.4 version

Discussion in 'Misc WordPress Requests' started by bcworkz, Feb 20, 2018.

  1. bcworkz


    Reply To: date_i18n broken in latest 4.9.4 version, by bcworkz

    I cannot replicate your issue, date_i18n() returns locale language dates on my 4.9.4 site. For $unixtimestamp set to time() in your code, I get 20 de febrero del 2018 using your code when my site is set for spanish.

    Do you have all the proper language files installed in wp-content/languages/? Set the site’s language to español in Ajustes generales? Probably, just making sure. Be sure your server has es_ES locale available. It might help to add setlocale( LC_ALL, 'es_ES'); (use the spanish version appropriate for your location if not Spain) to wp-config.php if it is not already there.

    If that all checks out, a plugin or your theme could be interfering with proper locale use. Temporarily copy your code to a template of the twentyseventeen theme. Set $unixtimestamp to an arbitrary timestamp, time() for example (get_field() will not be available in the next step). Install and activate the health-check plugin and invoke the troubleshooting mode. Load a page that uses the template you added your code to. You’ll see that the date is properly translated. Activate your theme and plugins one by one using the troubleshooting item in the admin bar. When date translation again fails, the last activated module is at fault.

    Reply To: date_i18n broken in latest 4.9.4 version

Share This Page

Monarch Social Sharing Plugin