Visit Yahoo Buzz Button page to find out more about yahoo buttons and styles. They also provide a simple code for button which you have to manipulate to get it working for various CMSs.
Here is a simple code which adds Yahoo Button to wordpress posts.
[php]<script type="text/javascript">
yahooBuzzArticleHeadline = "<?php the_title(); ?>";
yahooBuzzArticleSummary = "<?php the_excerpt(); ?>";
yahooBuzzArticleCategory = "entertainment";
yahooBuzzArticleType = "text";
yahooBuzzArticleId = window.location.href;
</script>
<script type="text/javascript"
src="http://d.yimg.com/ds/badge2.js"
badgetype="text-votes">
</script>
[/php]
You can copy above code and place it wherever you want to display inside the post loop. The code is self explanatory. For various values visit Yahoo Buzz Button page.
It should be between
[php]<?php if (have_posts()) : while (have_posts()) : the_post(); ?>[/php]
and
[php]<?php endwhile; else: ?>[/php]
Above code works great except that it doesn’t accept category. Not sure why. Didn’t get time to figure it out. If someone knows the solution then drop in the comment below.
And yes before commenting that it doesn’t work, don’t forget to delete cache if you are using any cache plugin.
You can see a live working example on movie reviews blog.
Leave a Reply