-
AuthorPosts
-
August 6, 2014 at 9:22 am #300547
Hi Im tryin to add google translation to enfold (opposite logo)
1. where do I add
<meta name=”google-translate-customization” content=”XXXXXX”></meta>
2. What ” do I need to escape on ‘ below when I add to function-set-avia-frontend.php around line 439?
<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>August 7, 2014 at 2:19 pm #301117Hi bensmithdesign!
Thank you for using the theme
Please add this on functions.php:
function add_google_translate() { ?> <meta name="google-translate-customization" content="XXXXXX"></meta> <?php } add_action('wp_head', 'add_google_translate'); function add_google_translate_script() { ?> <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> <?php } add_action('ava_after_main_menu', 'add_google_translate_script');
This will add the translator right after the main menu.
Cheers!
IsmaelAugust 7, 2014 at 3:38 pm #301158thank you thanks great, how do I put it right of the logo not the menu?
August 7, 2014 at 5:20 pm #301220Hi!
You can probably use css to change the position – please post a link to your website and we’ll see if we can provide some code to change the position.
Regards,
PeterAugust 7, 2014 at 6:28 pm #301248thanks dude, afraid its local.
I need it outside the nave menu ideally in
#header_main
or.container
?
August 8, 2014 at 4:48 am #301428Hey!
Try using this code:
#google_translate_element{ position: absolute; top: 0; right: 120px; }
Modify the top/right values until you get the desired result.
Regards,
JosueAugust 8, 2014 at 8:45 am #301485Thanks it does move but the plugin isnt clickable when the position is moved?
August 8, 2014 at 8:47 am #301486Hi!
Maybe you need to increase its z-index value:
#google_translate_element{ z-index:1000; }
Best regards,
JosueAugust 8, 2014 at 8:49 am #301487Sorry tried that, its when I add
top: -40px
August 8, 2014 at 4:53 pm #301713Hi,
Please make the site live then reply back to this topic so we can assist you better.
Regards,
JosueAugust 8, 2014 at 9:25 pm #301822Sorry I need to show client it working first, again its
How do I create a new marker position like ‘add_action(‘ava_after_main_menu’)
and add in it position
function-set-avia-frontend.php around line 439Thanks for your time.
August 8, 2014 at 10:16 pm #301828Hey!
There is already a hook (avf_logo_final_output) you can use to append something to the logo, try:
function add_google_translate_script($logo, $use_image, $headline_type, $sub, $alt, $link) { ob_start(); ?> <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> <?php $logo .= ob_get_clean(); return $logo; } add_action('avf_logo_final_output', 'add_google_translate_script', 10, 6);
Regards,
JosueAugust 9, 2014 at 9:26 am #301960Great nearly there, but it makes the height of the translation box triple the size?
August 10, 2014 at 3:16 am #302107Try adding this code to the Quick CSS:
#google_translate_element{ line-height: initial !important; }
To change its position reference the previous codes in this thread.
Regards,
JosueAugust 11, 2014 at 11:42 am #302487Great many thanks :)
-
AuthorPosts
- The topic ‘google translation plugin’ is closed to new replies.