Archive for the 'WordPress Hacks' Category

Different approach to mananging your bookmarks

I know there are a million ways to do this from browser bookmarks to digg and del.icio.us, but I keep tabs on my important stuff with WordPress. Say you have link that is critical to you and want to reference later. If you are using wordpress you can simply create a new page and never publish it. It is a good way to keep your important stuff all in one place. I put all my affiliate links and reference content related to this site in an unpublished page in my admin section.

Bookmarks get cluttered quickly. Ever look at all you bookmarks and wonder where the hell they all came from?? And you really don’t want to store important info in a digg account. The purpose is not to share these links with others, but have the important things handy when you need them. Try using your WordPress page feature for these things.. make little notes for each link and they will be there when you need them. You can thank me later.

Put a Floating Digg Badge in Your Posts

Next thing I figured I needed was a way to link into the social networking sites. You can download a plugin to display the most popular user submit tags from the WordPress plugin directory, but i didn’t see a plug in to put the new Digg badges in your posts. You know like the one you see in this post. So i did what any self respecting MacGyver would do… get into the code.

You can edit the template files in your WordPress admin or with a text editor. Use whichever you’re comfortable with. i just used the WordPress editor since it was a quick and simple fix. Open the index.php file and find this line of code..

<?php the_content(__(’Read more »’));?>

Add the following code right above that line.

<div style=”float:left;margin-right:5px;”><script type=”text/javascript”>
digg_url = ‘<?php the_permalink() ?>’;
</script>
<script src=”http://digg.com/tools/diggthis.js” type=”text/javascript”>
</div>

This is the generic digg badge code, the only thing of note is the ‘dig_url’ variable. It calls a WordPress method to set the url for digg to the permalink of the post.

Now do the exact same with the file ’single.php’. This way the badge will appear on the main page of your blog as well as the single entry page.