Quantcast
Channel: EchoDitto Labs - Today I Learned...
Viewing all articles
Browse latest Browse all 20

Customizing ShareThis WordPress plugin

$
0
0
I wrote about this on my personal blog after realizing that having the ShareThis links at the end of my blog posts might actually prevent them from being shared as much, assuming that most people won't read the posts in their entirety (sad, but probably true). For those of you already confused, ShareThis is a WordPress plugin that enables users to share your content. It places icons after each post to share via Twitter, Facebook, Email, etc,

So in addition to having ShareThis links after each post, I decided to add them to the left sidebar where it lists the date of the post, and comments.

Once you enable ShareThis, and set the links to show up for each post, it automatically grabs the information for that post when you share it. So, if you just copy the code for ShareThis to another place on your site, it won't work, because it's no longer pulling the actual post info: Title, URL, etc.

I fixed this by adding in a few WordPress functions that call for the title and URL of the post. For example, instead of doing this:    <span class='st_facebook' st_title='{TITLE}' st_url='{URL}'></span> I called for the actual permalink and title of the post. Like so: <span class='st_facebook' st_title='<?php the_title()?>' st_url='<?php the_permalink()?>'></span>

Seems to me this is a pretty awesome (and super easy) tweak to ShareThis if you don't want it at the end of each post.


Viewing all articles
Browse latest Browse all 20

Trending Articles