-
AuthorPosts
-
March 17, 2015 at 5:33 am #412770
Hello, Please help.
I want to add images of contact no. and email on the top right corner of header.
I’ve tried to put directly to helper-main-menu.php already. and it’s working.But now i want it to change that image to another language version when i switch between TH/EN.
I don’t know how to do this. Is there any possible way to do it ? or maybe add widget position on top right there ?Please help
Thank you
March 17, 2015 at 12:57 pm #412896Hi zmkstudio!
Thank you for using our theme.
If you are using WPML you can use the following function to determin the current active language:
icl_get_current_language()
You can put the output of the images in an if clause like:
if(icl_get_current_language() == 'en' { /// output for english } else { /// output for other language }
Come back, if you need more assistance.
You can post the codesnippet here and we can give you the correct snippet to insert.
Cheers!
GünterMarch 17, 2015 at 9:33 pm #413240Please help
I tried but it’s not working , please see my code below.<div style="float:right;height:100px;"> <?php if(icl_get_current_language() == 'en' { <img src="http://www.firstchoicetranslation.com/images/contact-boxen.jpg" /> } else { <img src="http://www.firstchoicetranslation.com/images/contact-box.jpg" /> }?> </div>
Thank you
March 18, 2015 at 8:38 am #413452March 19, 2015 at 6:39 am #414172Hi , Please help
I place it on helper-main-menu.php , next to website logoMarch 20, 2015 at 6:48 am #415059Hey!
The code should be:
<div style="float:right;height:100px;"> <?php if(icl_get_current_language() == 'en') { echo '<img src="http://www.firstchoicetranslation.com/images/contact-boxen.jpg" />'; } else { echo '<img src="http://www.firstchoicetranslation.com/images/contact-box.jpg" />'; }?> </div>
Make sure that the html tags are not enclosed inside php..
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.