WordPress.org

Ready to get started?Download WordPress

Forums

Smart Layers by AddThis
[resolved] Bit.ly links not working (8 posts)

  1. waffenss
    Member
    Posted 9 months ago #

    Have in my addthis profile bit.ly account settings setup but sharing from sidebar shows URL description, site title, then long URL making it impossible to share correctly.

    Is this even compatible with smartlayer?

    http://wordpress.org/plugins/addthis-smart-layers/

  2. waffenss
    Member
    Posted 9 months ago #

    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

  3. Sol
    AddThis Samurai
    Plugin Author

    Posted 9 months ago #

    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.

  4. bmorebiostats
    Member
    Posted 8 months ago #

    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!

  5. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 8 months ago #

    @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

  6. bmorebiostats
    Member
    Posted 8 months ago #

    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!

  7. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 8 months ago #

    @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.

  8. bmorebiostats
    Member
    Posted 8 months ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic