Posts tagged with: hack

Removing ShareThis from your WordPress Front Page

After installing the ShareThis social plugin for WordPress I was surprised to find that there isn’t an easy option to exclude the social links from showing up on the front page. Luckily, it’s as easy as inserting a small bit of code into the sharethis.php plugin file.
On my system the file is located at [code]{wordpress root directory}/wp-content/plugins/share-this/sharethis.php[/code]

Open up the file in your favorite editor and go to nearly the bottom of the file and find the function (around line 601 in the version that I have) st_makeEntries

Add in the following code
[sourcecode=”php”]
if(is_front_page()){ return ”; }
[/sourcecode]

So that the beginning of your function looks like this:
[sourcecode=”php”]
function st_makeEntries(){
if(is_front_page()){ return ”; }
global $post;
… the rest of the function follows …
[/sourcecode]

We are basically bypassing the code that builds the social badges and returning nothing instead of the HTML that the code would otherwise build.