Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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

    #412896

    Hi 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ünter

    #413240

    Please 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

    #413452

    Hey!

    Where did you place the code?

    Regards,
    Rikard

    #414172

    Hi , Please help
    I place it on helper-main-menu.php , next to website logo

    #415059

    Hey!

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.