Skip to content

[WordPress] Display Different Footer In Different Language Site With Polylang

Last Updated on 2022-01-11 by Clay

Polylang is a useful plugin of WordPress website, it can help us to mapping a specific language article to the other language article (but they are still the same just written by different language...). If user want to change the language, they use use a language switcher tool to do it.

Recently, a netizen asked: He/She has established a multi-lingual website, but only one language can be displayed at the end of the page.

I did a little research and found that there are two different approaches:

  • Create different text widget widget and then place them in the footer
  • Edit polylang php code directly

Basically I don't recommend the second method. Because modifying the original code bears the risk of breaking it, and if the plugin is updated in the future, the edited code will be lose.

If you really want to edit polylang code, I put a link at the references.


Create different language text widget

My own website just have Chinese and English, so I use them to demo.


Step 1: Create text widget

Appearance > Widget:


Select Text:


In my case, I created a set of emails in Chinese and a set of emails in English.


Step 2: Add footer widget is customize mode

Appearance > Customize:


Then add the text widget you just set to the footer, and set one for Chinese and one for English.


Demo

Of course, due to the different theme themes used by each website, this method cannot be guaranteed to be applicable to all themes, but I hope it can be provided as a reference for those who need it.


References


Read More

Tags:

3 thoughts on “[WordPress] Display Different Footer In Different Language Site With Polylang”

  1. Thanks for this article…. it would have made it easier it the text was in Enlish instead of Chinese ^^

  2. Vladimir Kazakov

    To work this way, the theme must have a header and footer widgetarea. It is not difficult.

    But in header.php there are lines for the logo, title and description of the site, and for them there is no translation in the admin panel and there is no way to download the logo for other languages.
    jetpack_the_site_logo();
    bloginfo( ‘name’ );
    bloginfo( ‘description’ );

    You can use the custom-post-widget plugin to create a Gutenberg block for header widgetarea instead of header.php. But this is not a universal method, and it is not always convenient.
    And so far I don’t see any other variant.

    If you make the “Site Name” or “Site Description” option in the theme, you will need to create the same options for all languages added to Polylang. That is, you need to make a request to the Polylang database about the availability of languages. But then you need to upload several logos in the theme.

    1. Vladimir Kazakov

      For
      bloginfo(‘name’);
      bloginfo(‘description’);
      Translation here:
      Translation strings – /wp-admin/admin.php?page=mlang_strings
      blogname — WordPress
      blogdescription — WordPress

Leave a Reply