Home Forums Pure Theme Discussion & Support Add Google button under Tweet, Facebook buttons below content

This topic is: not a support question

This topic contains 7 replies, has 3 voices, and was last updated by  Roger Leitch 4 years, 11 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2288

    kam onn siew
    Participant
    Post count: 12

    I just came across “http://www.wprecipes.com/wordpress-hook-automatically-add-a-google-button-to-your-posts?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Wprecipes+%28WpRecipes.com%3A+Daily+recipes+to+cook+with+WordPress%29&utm_content=Google+Reader”.
    How and add the Google button to my site under the Tweet and Facebook buttons.

    #2298

    themeweaver
    Keymaster
    Post count: 730

    That’s quite easy. I’ve used the code and made it work for our themes. Just add this to the function.php in a child theme:

    function livingos_google_plusone() {<br />
    		echo '&lt;div class="plusone"&gt;&lt;g:plusone size="tall" href="'.get_permalink().'"&gt;&lt;/g:plusone&gt;&lt;/div&gt;';<br />
    	}<br />
    add_action('livingos_share_btns','livingos_google_plusone');<br />
    <br />
    add_action ('wp_enqueue_scripts','livingos_google_plusone_script');<br />
    function livingos_google_plusone_script() {<br />
    	wp_enqueue_script('google-plusone', 'https://apis.google.com/js/plusone.js', array(), null);<br />
    }<br />
    
    

    So easy in fact I think we may add this to the theme’s core code. Of course we made this function so that you could add any buttons you like, provided you have the code.

    #2325

    themeweaver
    Keymaster
    Post count: 730
    #2343

    kam onn siew
    Participant
    Post count: 12

    “Heroic Support” indeed !

    #2344

    themeweaver
    Keymaster
    Post count: 730

    🙂

    #2358

    Roger Leitch
    Participant
    Post count: 56

    Please to see this feature has been added to the theme.

    Just a question about layout.

    How feasible is it to have it as an option that these are arranged in a row instead of above each other?

    #2359

    themeweaver
    Keymaster
    Post count: 730

    Actually the latest versions of our themes have them in a row. Download and clear your browser cache.

    #2382

    Roger Leitch
    Participant
    Post count: 56

    Great – looks neater IMHO.

    🙂

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.