In my Wordpress + Polylang website, accueil is the page name of homepage in French and inicio is the page name of homepage in Spanish.
So the homepages are:
English : https://www.example.com
French : https://www.example.com/fr/accueil/
Spanish : https://www.example.com/es/inicio/
Is it possible to get the homepage url of a selected language?
I use home_url() to get the homepage.
And I use pll_current_language() polylang function to get the selected polylang language code of the website.
But home_url() returns same English homepage url even if I select any other language.