Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   [SOLVED] WPML & Atahualpa -> How to place a horizontal language switch in the header (http://forum.bytesforall.com/showthread.php?t=14810)

Flavio Jul 3, 2011 09:12 AM

[SOLVED] WPML & Atahualpa -> How to place a horizontal language switch in the header

I am copying a question I also posted on WPML forum, hope I can get help from one side or another :)

I am using the latest current versions of WP (3.1.4), Atahualpa (3.6.7) and WPML (2.3.2 - CMS commercial version).

Actually the main reason for upgrading to the commercial version of WPML, was that I hoped I could get more options to integrate the switch within the theme... but I can't see any change in the available options. Did I miss anything?

Anyway... my goal is... to place the language switch as in this site: http://www.pietvanoostrum.com/en/ ie. in the header area (Menu 1) floating at the right. The switch is horizontal (like in the "standard footer" which one can choose in WPML settings).

If you can help, please, I need a truly "step-by-step" guide... I am far from being a literate in CSS!

Anyone can help? Thank you!

juggledad Jul 4, 2011 05:59 AM

looking at the source of that page, they just added a <div>...</div> with the appropriate links and images to ATO->Style & edit HEADER AREA->Configure Header Area just before the %pages
Then they used CSS Inserts to move it to where it exists.

If you use FireBug in FireFox. you will be able to go in and examine how they did it.

Flavio Jul 6, 2011 03:19 AM


Thanks for having a look at the issue.

After posting in this forum, I got a feedback from the author of the blog. He mentioned, that he had input the following code in the options of ATO -> Style & Edit Header Area

<code>%logo %bar1 %image %bar2 <?php do_action('icl_language_selector'); ?>

i.e. he injected a PHP code there (the code is taken from WPML instructions)... at the time ATO allowed this :)

Therefore the question now is... where can I place the line <?php do_action('icl_language_selector'); ?> (I assume I have to go to the theme edit, but which file? and where precisely within the file?

I assume it shouldn't be that complicated... for you, I mean (I am not very technical myself)... ;)

juggledad Jul 6, 2011 05:27 AM

because of WordPress restrictions, you can no longer use most php in the header area, but you can put a new widget area there and add a text widget to it, put the php in it and then using the 'exec-php' plugin, cause the code to be executed.

1) install the 'exec-php' plugin and activate it
2) change your 'Configure Header Area' option to include
HTML Code:

<?php bfa_widget_area('name=header_widget_area'); ?>
3) go visit the front page of the website (this causes that code to be run)
4) go to the widget area - you'll now see a new widget area 'header_widget_area'
5) add a text widget to that area
6) add the '<?php do_action('icl_language_selector'); ?>' to the text widget
you may need to use a CSS inserts to position the are

Flavio Jul 6, 2011 07:02 AM

Great. Working fine... I just need to fine tune the styles, as you mentioned. Many thanks!

All times are GMT -6. The time now is 01:54 AM.

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