WordPress.org

Ready to get started?Download WordPress

Forums

gtrans
php code for inserting the language bar in the header and specific lang only (6 posts)

  1. webdesignlabs
    Member
    Posted 2 years ago #

    hi, this is a great plugin and its working perfectly, I just would like to know if its possible to create a code to insert it in the header instead of being just a widget on the side bar?

    also how do we limit the the number of languages from the translator/ for example i only want to show English and French, without showing other languages from the drop down?

    http://wordpress.org/extend/plugins/gtrans/

  2. fawkesblog2
    Member
    Posted 2 years ago #

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    Yes.

    first disable the widget.

    Now you need a call which is <?php echo do_shortcode('[gtrans]'); ?>

    If you want to have even more control than wrap that code like this <div class="gtrans"><?php echo do_shortcode('[gtrans]'); ?></div>

    Then in your style css add this

    .gtrans {
    bottom:0;
    position:fixed;
    z-index:160;
    _position:absolute;
    _top:expression(eval(document.documentElement.scrollTop+
    (document.documentElement.clientHeight-this.offsetHeight)));
    height:20px;
    }

    That will place it at the bottom of the browser. If you want it at the top then change the word "bottom" in the code to "top"

    If you want to do as i have done and put in in a far right corner then add this to your style css instead

    .gtrans {
        bottom:0;
        position:fixed;
        z-index:160;
        _position:absolute;
        _top:expression(eval(document.documentElement.scrollTop+
            (document.documentElement.clientHeight-this.offsetHeight)));
        height:22px;
    float:left;
    right:0px;
    }

    If you want to change from right to left simply swap the left and right commands in the code and bottom for top if you want it at the top of the browser.

    If you add a pixel count where it says right:0px it will move the language box away from the edge. The height will move it up or down.

    That should be enough information to give you all the control you need.

  3. fawkesblog2
    Member
    Posted 2 years ago #

    Here is my site so you can see how i have placed it http://chrisfawkes.net/blog/the-blog/

  4. Silky-Dream
    Member
    Posted 1 year ago #

    I have tried the above mentioned on my site http://www.silky-dream.dk but nothing is working.
    I have themeforrest wp-flexishop and I have tried to enter the code in the css editor. I have tried to change the pixel count due to all the footer and everything on the pages but it's not working.
    Please would you be able to help me out :)

  5. Sprigo
    Member
    Posted 1 year ago #

    I was running this plugin until last night when I discovered a hyperlink had been added to the top of every single page on my site. After a lot of digging around I found g-translate was the culprit.

    In the plugin folder there was a file called 'install.php' which contains a single line of code....

    <center><small><a href="http://sun-bingo.webeden.co.uk/">sun bingo webeden</a></small></center>

    Lucky for me that it was a rather lame site it links out to but I've deleted this plugin all the same.

  6. fawkesblog2
    Member
    Posted 1 year ago #

    Silky Dream, where have you placed the line <div class="gtrans"><?php echo do_shortcode('[gtrans]'); ?></div> I have it placed in the header.

    The other code in the css will manipulate that line of code which calls the plugin.

    Sprigo, not sure why you are getting the hyperlink. I don't get that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic