WordPress.org

Ready to get started?Download WordPress

Forums

Pinboard
how to get google translate fixed in top right. (14 posts)

  1. Angus Todman
    Member
    Posted 1 year ago #

    Hi, Hopefully someone can help me here. Im trying to get google translate to be fixed in the top right of every page in a fixed way (including home)
    like in this site.

    http://www.colingo.com/contact

    Ive tried some floating plugins like 'wp float' but cant seem to do it. maybe cause its out of date a little.

    Thanks in advance!

  2. paul.a.cunn
    Member
    Posted 1 year ago #

    Do you have a link to your site so I can see the issue?

  3. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Did you resolve the issue? If not, can you state which browser __and browser version__ the issue occurs in? If the issue is resolved, may you mark this thread resolved?

  4. Alexander
    Member
    Posted 1 year ago #

    @Andrew: Can you please explain WHY the browser__or browser version__ is needed as it should work cross-browser? And what ISSUE are you referring to? Also asking him, after 6 hours and zero response, if he resolved the issue is strange??

    Sounds like one of these standard copy & paste answers with no sense to me...

    I assume a link is not available as Angus ask for help HOW to.

  5. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    it should work cross-browser

    Really? Down to IE6? Are you the theme's author? And no, that wasn't copy pasta. It was reasonable question to ask.

  6. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Alexander, please don't post in others' threads unless you're contributing towards the original posters' issues.

    Edit: If you must know; I couldn't experience the issue in the latest version of Chrome, which is why I first asked whether the issue was resolved and then the browser version.

  7. Angus Todman
    Member
    Posted 1 year ago #

    Thankyou all for the responses.
    Alexander is right as I dont have a link to the issue because I trying to put the translate option in the very top right in a fixed way in my page.

    I have used a workaround for the time being. Here is a link to my site as you requested.
    http://www.globallingos.com

    Here is a link to a web page with exactly how I would like to present my translate in my page

    http://www.colingo.com/contact

    in response to browser. Im using the latest, firefox and chrome.

    Many thanks in advance!

  8. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Did you try some CSS like absolute positioning?

    position: absolute;
    top: 0;
    right: 0;

    You know in future; you can provide the HTML and CSS for one relevant webpage through PasteBin and we can construct the webpage through CSSDesk or jsFiddle.

  9. Angus Todman
    Member
    Posted 1 year ago #

    Thanks Andrew! So how would I incorperate the translate code with what you have just suggested?
    here is the code.

    <div id="google_translate_element"></div><script type="text/javascript">
    function googleTranslateElementInit() {
      new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, gaTrack: true, gaId: 'UA-39051346-1'}, 'google_translate_element');
    }
    </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
  10. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Download (and install) a Custom CSS Manager plugin, then, in the plugin's Custom CSS Manager section of the dashboard, enter this;

    #google_translate_element {
     position: absolute;
     top: 0;
     right: 0;
    }
  11. Angus Todman
    Member
    Posted 1 year ago #

    Thanks alot Andrew!!! thats brilliant :) do you know how to make it like it is on the link

    http://www.colingo.com/contact

    In that site, its positioned top right though when you scroll down its still in the top right position. I tried looking up some css positioning examples though could not get it right.

    Many Thanks!

  12. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Yes, you know that code I recommended in the post prior to this?
    Replace this part;

    absolute

    With this word;

    fixed
  13. Angus Todman
    Member
    Posted 1 year ago #

    Thanks again Andrew, I tried that before and for some reason its appearing close to where the widget has been placed. I if I place it in the header sidebar its all distorted and in the middle.
    Should I place the google translate code in header php or (somewhere else) instead of a text box in a widget to make it work properly?

    with the absolute code it appear perfetly in the top right regardless of which sidebar the code is placed in.

  14. Angus Todman
    Member
    Posted 1 year ago #

    there are two parts to the translate code.

    <meta name="google-translate-customization" content="5f1236b7ad3c9e32-c0c3fac3c04860c5-g52f2c280ec5208e6-14"></meta>

    That part has been placed in the </head>.

    the other code above had been placed in widgets in text boxes somewhere on each page.

    Many thanks!!! :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.