Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter waffenss

    (@waffenss)

    tried this

    var addthis_share = {
         // ... other options
         url_transforms : {
              shorten: {
                   twitter: 'bitly'
              }
         },
         shorteners : {
              bitly : {}
         }
    }

    Does not work modified it a couple time still doesn’t work makes sidebar disappear

    Sorry to hear you weren’t able to get this working. Can you provide a link to a page where you have the code enabled? I have tried and was able to verify that bit.ly shortening is working with Smart Layers, but it would help if I could see your actual code to troubleshoot.

    Hello, I am also trying to get this to work and have not been able to. In the AddThis Smart Layers configuration panel at my WordPress.org site, I chose the option to enter the code myself instead of using the WYSIWIG.

    The following works, except for the bit.ly part:

    {
        'theme' : 'transparent',
        'share' : {
            'position' : 'left',
            'numPreferredServices' : 5
        },
        'follow' : {
            'services' : [
            {'service': 'facebook', 'id': 'bmore.biostats'},
            {'service': 'twitter', 'id': 'bmorebiostats'},
            {'service': 'linkedin', 'id': 'bmorebiostats'},
            {'service': 'rss', 'id': 'http://feeds.feedburner.com/BmoreBiostats'}
          ],
            'offset' : {'top':'50px'}
       }
    }

    However adding the code shown by waffenss above does not work. So basically, how do you have to set it up?

    Site is http://bmorebiostat.com/

    Thank you for the help!

    @bmorebiostats The bitly is working when I tried. Can you add the bit.ly configuration to the smart layers and then update here? I need to check how it’s failing when you have enabled bit.ly

    I finally looked at the source code (once deployed) of bmorebiostat.com and got the bit.ly connection working via a minor tweak.

    Basically I noticed that the code you write in the WordPress admin becomes

    <script type="text/javascript">var addthis_product = 'wpp';
    </script><script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-527c1a6d32e98eb8"></script><script type="text/javascript">addthis.layers(
    
    CODE YOU WRITE
    
    );</script><style type="text/css">.addthis_toolbox {float:left;width:100%;margin:0 0 15px 0;} .addthis_button_tweet {min-width: 83px;float:left;}</style><script type='text/javascript' src='http://s0.wp.com/wp-content/js/devicepx-jetpack.js?ver=201345'></script>

    Meaning that the ); at the end was creating incorrect javascript code when I naively inserted the code @waffenss showed (which comes from the AddThis documentation).

    So using in WordPress the following code:

    {
        'theme' : 'transparent',
        'share' : {
            'position' : 'left',
            'numPreferredServices' : 5
        },
        'follow' : {
            'services' : [
            {'service': 'facebook', 'id': 'bmore.biostats'},
            {'service': 'twitter', 'id': 'bmorebiostats'},
            {'service': 'linkedin', 'id': 'bmorebiostats'},
            {'service': 'rss', 'id': 'http://feeds.feedburner.com/BmoreBiostats'}
          ],
            'offset' : {'top':'10px'}
       }
    } );
    var addthis_share = {
    	// ... other options
    	url_transforms : {
    		shorten: {
    			twitter: 'bitly'
    		}
    	},
    	shorteners : {
    		bitly : {}
    	}
    };
    var myfunc = function(testparam) {
          return true;
    };
    var mynothing = myfunc(true

    I end up with:

    <script type="text/javascript">var addthis_product = 'wpp';
    </script><script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-527c1a6d32e98eb8"></script><script type="text/javascript">addthis.layers({
        'theme' : 'transparent',
        'share' : {
            'position' : 'left',
            'numPreferredServices' : 5
        },
        'follow' : {
            'services' : [
            {'service': 'facebook', 'id': 'bmore.biostats'},
            {'service': 'twitter', 'id': 'bmorebiostats'},
            {'service': 'linkedin', 'id': 'bmorebiostats'},
            {'service': 'rss', 'id': 'http://feeds.feedburner.com/BmoreBiostats'}
          ],
            'offset' : {'top':'10px'}
       }
    } );
    var addthis_share = {
    	// ... other options
    	url_transforms : {
    		shorten: {
    			twitter: 'bitly'
    		}
    	},
    	shorteners : {
    		bitly : {}
    	}
    };
    var myfunc = function(testparam) {
          return true;
    };
    var mynothing = myfunc(true);</script><style type="text/css">.addthis_toolbox {float:left;width:100%;margin:0 0 15px 0;} .addthis_button_tweet {min-width: 83px;float:left;}</style><script type='text/javascript' src='http://s0.wp.com/wp-content/js/devicepx-jetpack.js?ver=201345'></script>

    which works.

    Do you suggest another solution? I guess that it would be nice to avoid creating the myfunc function and mynothing variable.

    Anyhow, it would be nice to have this documented somewhere.

    Thank you for the help!

    @bmorebiostats: The perfect way to achieve this is by installing AddThis Share plugin and configuring Bit.ly in it. In share plugin, check the Advanced Tab to see the bit.ly configuration.

    Thank you @srijith.v Using both plugins worked perfectly like you said!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bit.ly links not working’ is closed to new replies.