This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to have logo in PT and in ES. This is a handmade theme i created by starting off with TWENTYSEVENTEEN theme. Is there a way I can have this behavior?

Solution: Solution here: https://wpml.org/forums/topic/translate-logo-based-on-language/#post-2245347

This topic contains 2 replies, has 2 voices.

Last updated by estherP 1 year, 4 months ago.

Assigned support staff: Noman.

Author Posts
May 28, 2018 at 10:35 am #2237876

estherP

Tell us what you are trying to do?
I am trying to have logo in PT and in ES.
This is a handmade theme i created by starting off with TWENTYSEVENTEEN theme.
Is there a way I can do have this behavior? I've read other threads, but since TWENTYSEVENTEEN is a popular theme, I wanted to know if there is a solution that can be put in place.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
hidden link

Thank you very much

May 29, 2018 at 11:47 am #2245347

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello,

Thank you for contacting WPML Support.

1) If you have added logo from Appearance >> Customize > Site Identity > Logo as in attached screenshot

Then you can translate logo by following below steps:

- Go to WPML >> String Translations >> Translate texts in admin screens »
- Search for the theme_mods_twentyseventeen and expand it with the +
- Select custom_logo ID checkbox option as in attached screenshot
- Scroll all the way down and press the 'Apply' button
- Go to WPML >> String Translations
- Translate the string for the logo ID, with your translated logo image ID.

2) If you have added logo through custom code in the theme and not used theme options then you can use translated logo through code.

It will be something like this:

$my_current_lang = apply_filters( 'wpml_current_language', NULL );
if(my_current_lang  == "pt"){
//add the logo for pt
} else if(my_current_lang  == "es"){
//add the logo for es
}

Please let me know how it goes,

- If still issue persists, please add the debug report in the Debug Information box. I have also enabled debug info box for your next reply: https://wpml.org/faq/provide-debug-information-faster-support/

Thank you

May 29, 2018 at 6:19 pm #2247756

estherP

I had the image id in my own theme_mods in the admin screens.
It worked. Thanks