• Resolved sangram.patra

    (@sangrampatra)


    Anyone is there.

    I want to use g+ share button in my author page to share my custom link to g+ but i am not able to do this.

    I have written the code like below :

    <script type=”text/javascript” src=”https://apis.google.com/js/plusone.js”></script&gt;
    <g:plusone href=”<?php echo get_permalink();?>”></g:plusone>

    I know ther is a plugin for that but i want to use it only for custom link share link.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Your issue is most likely related to the fact that you are using the HTML 5 version instead of the XHTML version. Your theme is very likely to be coded in XHTML and not in HTML 5.
    Add this line of code in the <head> section of your blog in header.php, before the </head> tag:

    <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
    //<![CDATA[
    { parsetags: 'explicit' }
    //]]>
    </script>

    and place this code where you want the g+ button to appear:

    <div id="plusone-div"></div>
    <script type="text/javascript">
    //<![CDATA[
    gapi.plusone.render
    (
        'plusone-div',
        {
            "size": "standard",
            "count": "true"
        }
    );
    //]]>
    </script>

    If you wish, you can change the appearance of the button by changing the size parameter and enable/disable the share count. For more information about these paramters, you should check out the g+ documentation.

    Cheers!

    Marventus

    (@marventus)

    Hi,

    Were you able to figure this out? If so, could you please mark this thread as resolved?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘g Implementation’ is closed to new replies.