-
AuthorPosts
-
January 16, 2016 at 3:05 pm #566532
Hi, I would you like to make my website multilingual, so I want to add a languages bar in the header area (a bar with flag images and link them to different URLs when clicked), and I’m not going to use a plugin like WPML. I searched the archives to learn how I can add such bar, and found a post by Yigit in which he instructed that we should add code to the header.php file (and a couple of custom CSS lines) https://kriesi.at/support/topic/how-do-i-get-a-language-flag-on-the-top-above-the-search-bar/
The problem is, and I may be wrong, if we add any code to the header.php file, it will be erased with the first theme update. I’m using a child theme, but there is no header.php file in the child theme. So my question is, how can I add a flags bar to the header without it getting erased with the first theme update. Or let me know if there is any other solution, other than the one in the above link, for adding a flags bar to the header, thanks.January 16, 2016 at 9:07 pm #566598Hey amrman0!
The header.php file, can just be copyed from the original theme, to the child theme.
Then, it will get over-writted. Please do let us know if you have any more questions, we will be more than happy to help you out.Cheers!
BasilisJanuary 31, 2016 at 5:22 pm #575331Thank you for your reply. I now understand that I can copy the header.php file from the parent theme to the child theme. However, when I tried to follow the instructions in the old post by Yigit (referenced in my original post), I couldn’t because obviously some theme code has changed since 2013 (date of Yigit’s post). For example, he said “In your WordPress directory go to Choices folder and open Header.php file and search for “display the themes social media icons” “. There is no such phrase currently in the header.php file.
So please let me know how to add a language bar flags in the header area in the present day Enfold theme.January 31, 2016 at 7:22 pm #575364Hi,
Depends on what kind of header are you using, can you post the link to your website please? a mockup of what you want to achieve would be helpful too.
Regards,
JosueJanuary 31, 2016 at 9:30 pm #575427Hi, thanks for your reply. Here is a mockup of what I want http://postimg.org/image/ey4kpskrj/ But I would like to add more flags (not just 2 as in the mockup), like this bar http://postimg.org/image/vn60lphcv/
My under construction website URL is in the private reply, thank you.February 3, 2016 at 5:22 am #576868Hey!
Add the html markup of the flags in a text widget and then you can use the following filter. http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/
Best regards,
IsmaelFebruary 3, 2016 at 8:25 pm #577323Hi, I don’t know the HTML code for the flags language bar, can you supply it to me or do I have to hire someone?
February 4, 2016 at 4:02 am #577506Hi!
It’s not that hard, try something like this:
<ul class='custom_flags'> <li><a href='link1'><img src='flag_url1'></a></li> <li><a href='link2'><img src='flag_url2'></a></li> <li><a href='link3'><img src='flag_url3'></a></li> </ul>
Replace “link/flag_url” accordingly.
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.