Add Tweetmeme button

March 29, 2010

in Thesis Theme

I wanted to add the tweetmeme button to thesis, but

  • only on home and posts
  • not on pages
  • use small button in teaser,

so here we go:

In Thesis Open Hook add

Before Headline


<?php if (!( is_page() )) { ?>
<div class=”tweetmeme_button” style="float: right; margin: 5px 0 15px 15px;">
      <script type="text/javascript">
        tweetmeme_url = '<?php the_permalink(); ?>';
      </script>
      <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
    </div>
   
<?php } else { ?>

<?php } ?>

After Teaser Headline


<div class="tweetmeme_button" style="float: right; margin: 5px 0 15px 15px;">
<script type="text/javascript">
tweetmeme_style = 'compact';
tweetmeme_url = '<?php the_permalink(); ?>';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
  </div>

Et voila!

Leave a Comment

Previous post:

Next post: