Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #186310

    im looking for the code to insert an “Google plus button”. If i insert the script, the page has some conflict.
    Could you help me out?




    Hi Crippy!

    Where are you trying to insert the code? Can you please post the code here? You can insert it on a Text Block then switch to Text or HTML editor. If it doesn’t contain any php codes, it should work. Please use this plugin:



    Hi, i’ve installed the plugin you told me.

    The code still don’t work:
    <div class=”g-plusone” data-size=”medium” data-href=””></div&gt;
    <script type=”text/javascript”>
    window.___gcfg = {lang: ‘de’};

    (function() {
    var po = document.createElement(‘script’); po.type = ‘text/javascript’; po.async = true;
    po.src = ‘;;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(po, s);

    You can’t see it in the front end.



    Add this at the end of functions.php:

    function custom_script_func( $atts , $content = null ) {
    	return '<div class="g-plusone" data-size="medium" data-href=""></div><script type="text/javascript">window.___gcfg = {lang: "de"};(function() {var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;po.src = "";var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);})();</script>';
    add_shortcode( 'custom_script', 'custom_script_func' );

    Then, you can simply call it by using the [custom_script] shortcode wherever you want (tested locally).

    If you want to add attributes or make it more advanced you can use this tool to generate it.


Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Google Plus Button’ is closed to new replies.