2

I want to be able to show something like:

function foo()
{
    return "bar";
}

Is there a plugin?

I installed one called Code Markup, but this doesn't add any code options when I am adding a new post (at least not that I am seeing).

1

I use the SyntaxHighlighter plugin. It works well, is simple to use, and supports a good variety of languages.

See an article on my site for example output.

1

No need for a plugin.

All WordPress Setups come with this option available (unless you change the default setup).

Just enclose it as follows:

<code>function foo()
{
    return "bar";
}</code>

You can find it below.

Where is the code ?

0

Suppose I have a code written using Ruby.

In my blog post I would do

[sourcecode language="ruby"]
def hello
  puts "Hi! This is Rohit here"
end
[/sourcecode]

WordPress has this as a default feature. I haven't used any plugin for this.

  • I will try this out thanks. – JD Isaacks Mar 9 '11 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.