• If I Deactivate the polylang plugin this code works just fine. The months in the date formatting is translated in the correct language. But as soon as the polylang plugin is activated the translations no longer work, the months in the dates are only written in english.
    .wp_date(‘j F’, strtotime($startTime)).’ – ‘.wp_date(‘j F’, strtotime($endTime));

    Is there any work around for this. I still need polylang for the rest of the pages and translations on my site.

    All the best! 🙂

    • This topic was modified 3 years, 9 months ago by nilssonline.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    I just checked and the month is correctly translated for me.

    I suggest that you look for a conflict by testing your code with only Polylang and a default theme as I did.

    That said, I suggest that you use get_option( 'date_format' ) for your format instead of harcoding 'j F'. That way you’ll be able to use the date format from the WordPress settings that you can translate in Polylang strings translations.
    See also: https://developer.ww.wp.xz.cn/reference/functions/wp_date/#comment-5071

Viewing 1 replies (of 1 total)

The topic ‘wp_date in custom plugin doesn’t work with activated polylang plugin’ is closed to new replies.