Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #190715

    Hi there,

    I want to replace the container that holds the contact telephone number in the top right corner of the header with this Google translate script, I’ve tried loads of times but it just breaks the site :(

    <div class=’container’><div id=”google_translate_element”></div><script type=”text/javascript”>
    function googleTranslateElementInit() {
    new google.translate.TranslateElement({pageLanguage: ‘en’, layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, ‘google_translate_element’);
    }
    </script><script type=”text/javascript” src=”//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit”></script>

    Thanks in advance…

    #190762

    Hi silviouk!

    Please edit header.php, find this code:

    $phone = avia_get_option('phone');
                                $phone_class = !empty($nav) ? "with_nav" : "";
                                if($phone) echo "<div class='phone-info {$phone_class}'><span>{$phone}</span></div>";

    Replace it with:

    echo '<div id="google_translate_element">';
                                echo "<script type='text/javascript'>
                                function googleTranslateElementInit() {
                                new google.translate.TranslateElement({pageLanguage: 'en' , layout: google.translate.		TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');;
                                }
    							</script><script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'></script>
                                </div>";

    Remove browser cache then reload the page.

    Regards,
    Ismael

    #191497

    Perfect thanks!!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘REPLACE HEADER CONTACT NUMBER’ is closed to new replies.