21 February 2012

WordPress and Instapaper

I noticed that when I clipped my blog posts, some useless extra info got clipped too.
This was easy to fix with a few lines of code and the Instapaper publisher guidelines.

I have created a plug-in containing this code, available here: http://coopey.ml/m44u

If you want the code yourself it's:

<?php
function instapaper_ce($content = ''){
  if(is_single()){
    $content = '<div class="instapaper_body">' . "\n" . $content;
    $content .= "</div><!-- instapaper_body -->\n";
  }
  return $content;
}
add_filter('the_content', 'instapaper_ce');
?>