• I have a WordPress website where we need to create hundreds of pages (specific flight deals that change all the time) daily. We are creating those pages out of the WordPress Loop, but we are loading the header, sidebar & footer. Everything works fine except for the translations. We are using Polylang to make it multilingual.

    Those pages aren’t being registered as posts on WordPress and I’m manually pointing to their translation.

    The major issue I’m facing is that I can’t set the language of those pages. If I’m opening a French page directly (on an English browser), WordPress loads the English menu, sidebar, and footer.

    Also, if I’m coming from a previous page that was created with WordPress, and use my custom language switcher to change the language on any of those custom deal pages, WordPress keeps loading the previous language for the menu, sidebar, and footer.

    Is there a way to force the language on a page so that Polylang/WordPress loads the correct menu, sidebar, and footer?

    I’m already setting the HTML ‘lang’ parameter to my page language, tried to set the pll_language cookie to my page language (in PHP and JS, but both get overridden when the page loads).

    I’m using WordPress version 5.7.1 with Polylang 3.0.4

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

  • The topic ‘Set language on custom, out of the Loop, pages’ is closed to new replies.