0

I am using qTranslate on Genesis child theme and would like to be able to change the header image depending on the selected language.

Any ideas how can I do that?

1

This doesn't have much to do with Genesis, other than you need to hook into the header in one of several ways, with Simple Hooks http://wordpress.org/plugins/genesis-simple-hooks/ or in functions.php. I'll leave that to you.

But using

<?php echo qtrans_getLanguage(); ?>

do something like this:

$currentLang = qtrans_getLanguage();

if($currentLang == 'fr')
{   //show french logo
$imageName = logoFR.png';

} else

if($currentLang == 'hi')
{   //show Hindi logo
$imageName = logoHI.png';

} else { //show english logo to rest

$imageName = logoEN.png';

}

Or, name your images appropriately:

<img src="http://mysite.com/logo-<?php echo qtrans_getLanguage(); ?>.png" />

  • Unfortunately the header image is set via main css file and looks like this. .header-image #header #title-area { background: url(images/logo.png) left top no-repeat; } I am not sure If php will works here. – kozzmen Feb 3 '14 at 15:50
  • It's Genesis; you need to unhook the header image call in one of several ways, with Simple Hooks or in functions.php. – markratledge Feb 3 '14 at 15:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.