Forums

[resolved] [Plugin: Google AJAX Translation] How to move the translate link via jquery (2 posts)

  1. tomcat23
    Member
    Posted 2 years ago #

    Here is how I've been able to move the Translate link. I'm also formatting it smaller. This goes in your theme's functions.php file.

    function tcj_custom_jQuery() {
    	wp_enqueue_script('jquery');
    ?>
    <script type="text/javascript">
    
            jQuery(document).ready(function(){
                    jQuery("div.translate_block").appendTo("p.postedby");
            });
    </script>
    <style>
    	.translate_block{display:inline;font-size:x-small;margin-left:8px;line-height:1.3em;}
    </style>
    <?php
    }
    add_filter('wp_head','tcj_custom_jQuery');

    http://wordpress.org/extend/plugins/google-ajax-translation/

  2. monodistortion
    Member
    Posted 2 years ago #

    Sorry to make you go through that work. There will be a new method to put the button anywhere within the WordPress loop in the next version (coming soon).

    With your function it looks like you may run into problems with any page with multiple posts though, like the index page.

    You can change the CSS however you like pretty easily of course.

Topic Closed

This topic has been closed to new replies.

About this Topic