Only display Sphinnit on an SEO post

Here’s a useful tip for anyone who uses the wp-sphinnit plugin on a Wordpress blog that covers more than just SEO. Want to display the Sphinnit button on an SEO post but not on posts unrelated to SEO?

First of all, make sure you’ve set “align” to “none” in the Sphinnit options, or you’ll have two Sphinnit logos appear on every SEO post after implementing this code!

sphinnit options

Next, you need to edit your single.php file and use a conditional tag before calling the wp-sphinnit plugin. You’ll need to insert the following code before “the_post”:

sphinnit code

Category 4 is my SEO category – change the ‘4′ to the correct number for your own SEO category. That’s it!

To make things a bit more interesting, you might want the Digg button to appear in a certain category too. Try this:

code-with-digg-this

In theory you could have a social media submit button for every category you blog in. Perhaps Stumbleupon is a more appropriate button to have than Digg on specific categories, and vice versa in other cases. Have fun!

Trackbacks are closed, but you can post a comment

How do you rate this post?

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 4.50 out of 5)
Loading ... Loading ...

More to say? Help SEOgadget by reviewing the site on Google - Thank you!

seperator

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*