Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Languages & Translations »

Different Header Images for Different Languages using WPML


  #1  
Old Jun 2, 2014, 04:42 AM
moomum
 
164 posts · Aug 2010
Hello
I'm using WPML for http://papallaitants.fr/
It's going ok so far but I'd like the banner to be in French when it's a French reader and English when it's an English reader.

I found this https://wpml.org/forums/topic/can-i-...each-language/ which is helpful. It tells me to add some code.

"you need insert the link into img tags.

Then add the code into your header.php file where you display your logo.

<?php
if (ICL_LANGUAGE_CODE == 'en') { ?>

<img src="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-eng-2012.png"/>

<?php
} else if (ICL_LANGUAGE_CODE == 'es') { ?>
<img src="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-es-2012.png" />

<?php
} else if (ICL_LANGUAGE_CODE == 'ca') {?>
<img src="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-ca-2012.png" />

<?php
} else if (ICL_LANGUAGE_CODE == 'fr') {
?>
<img src="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-fr-2012.png"/>
<?php
}
?>

This seems clear enough but where is the header.php file?
Or is there a different way to do it?
  #2  
Old Jun 2, 2014, 06:42 AM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
You could perhaps add a new widget area where %image is in the configure header area box and add the code to a php aware widget that you put in that widget area.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Jun 2, 2014, 06:46 AM
moomum
 
164 posts · Aug 2010
Thanks Larry but that is way way over my head and out of my league.
Is it possible to add code to the header.php file and if so please can you tell me where it is

Last edited by moomum; Jun 2, 2014 at 07:29 AM.
  #4  
Old Jun 2, 2014, 09:32 AM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
header.php is in the theme folder but I don't thing that will be any easier for you or will even work. I never edit the theme files as the edit won't stay during an upgrade.

Adding a new widget area is no big deal. If you look in the theme options there are instructions on how to add a new widget area. Then you can search on wordpress.org for a php aware widget.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #5  
Old Jun 2, 2014, 09:57 AM
moomum
 
164 posts · Aug 2010
Thank you Larry, I'll take a deep breath and dive in
  #6  
Old Jun 2, 2014, 09:59 AM
moomum
 
164 posts · Aug 2010
if I can sort out the widget thing do I just use the code in the original post but with my links in a php aware widget?
  #7  
Old Jun 2, 2014, 10:02 AM
moomum
 
164 posts · Aug 2010
no results found for 'php aware' in WordPress plugins - Larry, would it be called something else? Sorry but I really have no idea what I am doing here so I don't know quite what to look for.

I understand about turning the banner area into a widget, am I then looking for a plugin that will allow me to put php into that widget area?
  #8  
Old Jun 2, 2014, 10:06 AM
moomum
 
164 posts · Aug 2010
I found this http://wordpress.org/plugins/content-aware-sidebars/
would that do the job?
  #9  
Old Jun 2, 2014, 10:15 AM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
I would need to experiment with that plugin to see if it would work. Will it allow conditionals that take language into account for instance?

One plugin I have use for entering php code is this one.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #10  
Old Jun 2, 2014, 10:17 AM
moomum
 
164 posts · Aug 2010
As always that is really helpful, thank you Larry. I have to stop now before my head falls off!
  #11  
Old Jun 11, 2014, 02:55 PM
moomum
 
164 posts · Aug 2010
I haven't sorted the header but I have got things responding to the language now so I'm confident I can do it. I've just made a widget that translates beautifully in the footer.
The add widget areas is really clear and straightforward. I put the code from the instructions straight into the footer area. I used Widget Logic and added 2 of the same widgets but in the Widget Logic area put this bit of code from WPML ICL_LANGUAGE_CODE == 'fr' on one and ICL_LANGUAGE_CODE == 'en' on the other to tell it which page to show up on.
Huge thanks!

Bookmarks

Tags
header, images, wpml



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Different rotating header images in different languages freelancekonsulenten Header configuration & styling 0 Aug 7, 2011 06:33 AM
[SOLVED] WPML &amp; Atahualpa -&gt; How to place a horizontal language switch in the header Flavio Header configuration & styling 4 Jul 6, 2011 08:02 AM
Languages? crashtest ThemeFrame Presales 2 Dec 19, 2010 06:12 AM


All times are GMT -6. The time now is 12:20 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.