WordPress.org

Ready to get started?Download WordPress

Forums

Thematic
how to echo google script for translate in functions php? (2 posts)

  1. furiousfrog
    Member
    Posted 2 years ago #

    Hi there,

    Really noob question: I'm working my way through the thematic theme and am looking to insert the script that you get from google to provide a translation widget. My PHP is still extremely shaky and I'd love some advice if possible?

    So, I need to get this script:

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

    attached to the thematic_header action hook.

    (I'd rather do it this way than install a translate plugin if possible)

    Any advice or even a nudge in the right direction would be hugely appreciated!

    http://wordpress.org/extend/themes/thematic/

  2. furiousfrog
    Member
    Posted 2 years ago #

    Never mind - the only way I've found to do this is to put the code directly in the header. Realise this isn't the preferred way to do things within thematic but I must admit I find using functions.php to do almost everything quite intimidating and a little frustrating for a beginner.

    Is there a good beginner tutorial for thematic that covers custom posts/taxonomies or covers the range of hooks? I've been through the "build your own wicked wordpress themes" but this is quite linear and only really provides instructions to create a basic theme type. I need to use custom taxonomies and custom post types and I'm not having much luck finding good information that's less than a few years old. The thematic wiki is not beginner-friendly so any advice would be welcome.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags