Archive for the 'Misc' Category

Apr 01 2008

Playing With Wordpress Code Highlighter Plugin

Published by David Jeffries under Misc

I just installed this code highlighter plugin for Wordpress, and it's really neat. It allows you to post any code you want between <pre> tags, and it will highlight/colour the text properly based on what language you tell it.

Language Support

This plugin uses GeSHi as a fontifier engine, and it supports many, many different languages. From applescript to java to sql this engine supports pretty much every popular language.

Line Numbers

You can also show the code with line numbers by adding lineno="{starting number}" to the pre tag like so: <pre lang="php" lineno="5"> which would start it on line 5. This does, however, make it difficult to copy and paste code because the line numbers are also copied.

PHP example (<pre lang="php">)

<?php
  class Test{
    public function Test(){
      echo "Test instantiated!";
    }
  }
?>

Java example (<pre lang="java">)

class Test{
  public static void main(String[] args){
    Test t = new Test();
  }
  public Test(){
    System.out.println("Test instantiated!");
  }
}

This is one of the most useful plugins I've ever seen, I love it. It makes posting code so much nicer and makes it way easier to read. Now I just have to update all my old posts that have code in them... For more information and to download, go to ideathinking.com

One response so far

Mar 31 2008

Using DoFollow to Increase Blog Comments

Published by David Jeffries under Misc

DoFollow, if you haven't heard of it, is a WordPress plugin that removes the rel="nofollow" from comments on your blog. The rel="nofollow" is placed there because with it, Google does not give any weight to the link. Before nofollow was introduced, spammers would go around to blogs and post comments with their name as the keyword they want to rank for, and the website they run. So with nofollow enabled on most popular blog platforms by default, the incentive to spam comments is not there.

Some people, however, choose to remove the nofollow from comment links, and this is why dofollow was created - to reward people for commenting. My personal feelings are that if your good enough to have a backlink then I will write about you in a post. I don't want to have to fend off all the spammers and people just posting for a measly backlink.

DoFollow Blog Lists

And yes, spamming and DoFollow go hand in hand. There are many DoFollow blog lists out there that highlight the blogs subject for people to get targeted links back to their sites. In fact, even after posting this blog post with the words "DoFollow" in the title my blog will be flagged and there will be an increase in blog comments.

So basically, if you want increased comments just blog about DoFollow - you don't actually need to enable the plugin, the comments will still come.

One response so far