{"id":245,"date":"2009-03-28T23:18:19","date_gmt":"2009-03-28T17:48:19","guid":{"rendered":"http:\/\/www.bin-co.com\/blog\/?p=245"},"modified":"2009-03-28T23:18:19","modified_gmt":"2009-03-28T17:48:19","slug":"adding-social-bookmarking-button-in-wordpress-without-plugins","status":"publish","type":"post","link":"https:\/\/www.bin-co.com\/blog\/2009\/03\/adding-social-bookmarking-button-in-wordpress-without-plugins\/","title":{"rendered":"Adding Social Bookmarking Button in WordPress &#8211; Without Plugins"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2009\/03\/social_bookmarking.png\" alt=\"Social Bookmarking\" title=\"Social Bookmarking\" width=\"148\" height=\"136\" class=\"alignnone size-full wp-image-244 intro\" align=\"right\" \/><\/p>\n<p class=\"intro\">Many blogs have links to add the current post to various social bookmarking site like Digg, Reddit, Delicious, etc. This blog don&#8217;t have it &#8211; but my <a href=\"http:\/\/lindesk.com\/\" title=\"Linux - on the Desktop\">LinDesk blog<\/a> does. This effect is achieved using wordpress plugins like&#8230;<\/p>\n<ul>\n<li><a href=\"http:\/\/blog.rswr.net\/2009\/02\/14\/social-media-wordpress-plugin\/\">S-ButtonZ Social Media Buttons &#8211; WordPress Plugin<\/a><\/li>\n<li><a href=\"http:\/\/wordpress.org\/extend\/plugins\/social-buttons\/\">WordPress \u203a Social Buttons<\/a><\/li>\n<li><a href=\"http:\/\/yoast.com\/wordpress\/sociable\/\">Sociable &#8211; Social Bookmarking for WordPress<\/a><\/li>\n<li><a href=\"http:\/\/andybeard.eu\/wordpress-plugin-hacks\">Hacked WordPress Plugins<\/a><\/li>\n<li><a href=\"http:\/\/lipidity.com\/web\/wordpress\/wp-plugin-gregarious\/\">WP Plugin: Gregarious<\/a><\/li>\n<li><a href=\"http:\/\/www.milienzo.com\/wordpress-plugins\/i-love-social-bookmarking\/\">I Love Social Bookmarking plugin<\/a><\/li>\n<li><a href=\"http:\/\/wordpress.org\/extend\/plugins\/add-to-any\/\">WordPress \u203a Add to Any Share\/Save\/Bookmark Button<\/a><\/li>\n<\/ul>\n<p>For those who are new, this is part three of the <a href=\"http:\/\/www.bin-co.com\/blog\/2009\/03\/wordpress-plugin-killer-series\/\">Plugin Killer series<\/a>. This series will show you how to duplicate the functionality of the a few wordpress plugins without having to install it using custom code in the wordpress theme. The earlier posts in this series are&#8230;<\/p>\n<ul>\n<li><a href=\"http:\/\/www.bin-co.com\/blog\/2009\/02\/avoid-duplicate-content-use-canonical-url-in-wordpress-fix-plugin\/\">Avoid Duplicate Content &#8211; Use Canonical URL in WordPress<\/a><\/li>\n<li><a href=\"http:\/\/www.bin-co.com\/blog\/2009\/03\/show-popular-posts-in-wordpress-without-a-plugin\/\">Show Popular Posts in WordPress &#8211; without a plugin<\/a><\/li>\n<\/ul>\n<h2>The Code<\/h2>\n<p>You can add social bookmarking button to your post by editing the <strong class=\"highlight\"><code>single.php<\/code> file in your theme<\/strong>. Go to the place in the file where you want the buttons to show up &#8211; then add this code at that location&#8230;<\/p>\n<pre><code class=\"html\">&lt;a href=\"http:\/\/del.icio.us\/post?url=&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php echo urlencode(the_title('','', false)) ?&gt;\"&gt;del.icio.us&lt;\/a&gt;\n | &lt;a href=\"http:\/\/digg.com\/submit?phase=2&amp;url=&lt;?php the_permalink() ?&gt;\"&gt;Digg it&lt;\/a&gt;\n | &lt;a href=\"http:\/\/reddit.com\/submit?url=&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php echo urlencode(the_title('','', false)) ?&gt;\"&gt;reddit&lt;\/a&gt;\n | &lt;a href=\"http:\/\/www.stumbleupon.com\/submit?url=&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php echo urlencode(the_title('','', false)) ?&gt;\"&gt;StumbleUpon&lt;\/a&gt;\n<\/code><\/pre>\n<p>Of course, you don&#8217;t have to do it like that &#8211; a better way of doing it is by putting the links in a li\/ul list and then styling it. The point is, you don&#8217;t need a plugin to do this.<\/p>\n<h2>Different Implementations<\/h2>\n<p>Another thing I would recommend is get the images &#8211; in the above code, I just used text links. If you get the favicons of the sites you&#8217;re linking to, it will look a lot nicer. <a href=\"http:\/\/lindesk.com\/2009\/03\/customizing-the-terminal-the-prompt\/\">Example<\/a> (go to the end of the post). You can use bigger images as well &#8211; <a href=\"http:\/\/aravindjose.com\/blog\/2009\/01\/30\/the-sensible-way-of-making-money-online-and-building-a-career-with-online-video\/\" title=\"Make a living out of Videos on Web. Seriously.\">example<\/a>. Or use some kind of effect &#8211; <a href=\"http:\/\/www.millionclues.com\/blogosphere\/blogging-tips-blogosphere\/getting-quality-backlinks\" title=\"Getting Quality Backlinks without Link Exchanges\">example<\/a>(here the icons are a bit transparent by default &#8211; but when you hover over them, it shows up clearly &#8211; its completely opaque).<\/p>\n<p>Here only the four big ones are given. You can find <a href=\"http:\/\/txt.binnyva.com\/2007\/02\/submition-to-social-bookmarking-sites\/\">code for more social bookmarking sites<\/a> elsewhere.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Many blogs have links to add the current post to various social bookmarking site like Digg, Reddit, Delicious, etc. This blog don&#8217;t have it &#8211; but my <a href=\"http:\/\/lindesk.com\/\" title=\"Linux - on the Desktop\">LinDesk blog<\/a> does.<\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,25,31],"tags":[67,69,212,213,259],"class_list":["post-245","post","type-post","status-publish","format-standard","hentry","category-php","category-scripts","category-wordpress","tag-bookmarking","tag-button","tag-plugin","tag-plugin-killer","tag-social"],"_links":{"self":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/comments?post=245"}],"version-history":[{"count":0,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/245\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/media?parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/categories?post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/tags?post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}