Social Media & Influencer Marketing

Social Bookmarks: Hide and Seek

UPDATE: – With the new site design and the lack of usage of the links, I decided to take them off. No complaints thus far! This modification still works if you would like to use it.

I was the butt of some joking going on over at Nektros. The entry was all about why you should get rid of all of those one-click social bookmarking links on your site. I’ve had a few other folks comment on them as well… someone told me I only had 25 [sarc].

I didn’t want to take them off… I kind of like them. I’m not sure why exactly, but I do. Besides making it easy to bookmark my page, I also want folks to see all the sites out there that help bookmark. There’s a ton of them! I’m sure, sooner or later, the good ones will rise to the top and the others will die off, but I don’t want to pressure anyone to use one or the other.

So… I did what any good hacker would do. I hacked the Sociable plugin and added some JavaScript that toggles the buttons on or off. It took 3 changes:

  1. Edit the Sociable Plugin to add the link to click on and off… note the bottom line hasn’t changed… that’s just to show you where to put the code in:
    <?php $post = $wp_query->post;
    $html .= '<ul><li><a class="link" title="Display all of the Social Bookmarking options." onClick="showdiv(\'bookmark_'.$postid.'\');">Social Bookmarking</a></li></ul>';
    $html .= '>div id="bookmark_'.$postid.'" class="sociable" style="display:none"><span class="sociable_tagline">';
    $html .= get_option("sociable_tagline"); ?>
  2. Edit the Sociable.css file to set add a hand/pointer cursor… because it’s simply an onclick event and not really a link:
    .link {
    cursor: hand;
    cursor: pointer;
    }
  3. Edit your theme’s header file to put the generic function in to toggle the div on and off:
    <script language="javascript">
     function showdiv(name){
     var obj = (document.getElementById)? document.getElementById(name) : eval("document.all[name]");
     if (obj.style.display=="none"){
     obj.style.display="";
     }else{
     obj.style.display="none";
     }
     }
    </script>

So, clicking the Social Bookmarking link will toggle the content on and off for the specific post!

Douglas Karr

Douglas Karr is the founder of the Martech Zone and a recognized expert on digital transformation. Douglas has helped start several successful MarTech startups, has assisted in the due diligence of over $5 bil in Martech acquisitions and investments, and continues to launch his own platforms and services. He's a co-founder of Highbridge, a digital transformation consulting firm. Douglas is also a published author of a Dummie's guide and a business leadership book.

Related Articles

4 Comments

  1. Yes, please do! I wanted to make use of this but think I did something wrong (though as ever with technology, not necessarily so) – I backed up the original, thankfully, because when I tried to implement the changes my blog broke – blank screen, no access to admin. A plugin variant would be so much less scary for those of us without the ability to do such cool things with confidence! 🙂 x

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close

Adblock Detected

Martech Zone is able to provide you this content at no cost because we monetize our site through ad revenue, affiliate links, and sponsorships. We would appreciate if you would remove your ad blocker as you view our site.