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).
Web Applications Stack Exchange is a question and answer site for power users of web applications. It only takes a minute to sign up.
Sign up to join this communityI 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).
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.
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.
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.