My theme (Novo Theme) lets you create pages as footers.
I created a footer in German and one in English and linked them in polylang.
In Polylang Settings > Custom post types and Taxonomies I checked everything including “Footers (yprm_footer_builder)”
The footer being displayed is always the one selected in Appearance -> Customize.
I tried adding
to the page template as suggested by Google AI.
I also tried adding
function switch_footer_language() {
if(pll_current_language=='th') {
get_footer('footer_th.php');
} elseif(pll_current_language=='en') {
get_footer('footer_en.php');
}
}
as suggested at Switch footer for different languages on WordPress website using Polylang plugin and Footer in multiple languages free WordPress
I couldn’t even get it to echo “DE” or “EN” depending on language, let alone to change the footer.
As far as I understand from posting on wordpress stackexchange at https://wordpress.stackexchange.com/questions/428859/changing-footer-according-to-language (question closed because outside their scope), I don’t need to load footer_en or footer_de but a page.
Different themes (like Avada Theme) apparently work by selecting the language as described here: Footer using Avada Theme in WordPress and the Polylang Plug-In but not Novo
I also contacted Envato Theme Support but got told customisation is beyond their scope. I have some programming skills and some worpress knowledge but not enough to take a good guess on where to start looking which support also didn’t want to tell me.
So, my questions are:
-
How do I find the location where the footer page gets picked?
-
Can I change it according to Polylang-Language using php? Would the ybove code be correct for querying the langauage set by polylang?
-
Would I (probably) have to change each template the theme provides or is there a more central location?