A multilingual custom header image

Some themes (Twenty Twelve, Responsive…) use the builtin WordPress custom header image. That’s a nice feature, but what if you include text in this header image? You will need one image per language! It is very easy to obtain thanks to the wpml-config.xml file.

Step 1: create a directory ‘polylang’ in ‘wp-content’ (this is a place where you can store Polylang cutomizations which will not be overwritten when updating Polylang).

Step 2: Copy paste the following code in a file called ‘wpml-config.xml’ that you upload in your ‘wp-content/polylang’ directory:

    <key name='theme_mods_twentytwelve'>
      <key name='header_image' />

You need to replace twentytwelve by the name of your theme (in fact the name of your theme directory)

Step 3: Set an header image in ‘Appearance -> Header’

Step 4: Go to Settings -> Languages -> Strings translations. You can now choose one header image url per language!

Picture illustrating the article by Alexas_Fotos and licensed under CC0 Public Domain.