Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a blog that I write up entries for that sometimes has programming code as part of the text within my writing's. Normally I use the quote function to give it a bit of highlighting, but was wondering if there's a better way that anyone has come across in their travels. Something that could do this for example:

function foo() {
     $var = "bar";
}

to highlight various property for the code like an IDE would.

Thought that this would have been asked before, but after searching didn't have any luck, so thought I'd ask. Thanks for anyone that can offer some help on this matter.

share|improve this question
2  
Try and Google "syntax highlighter wordpress plugins". –  Wyck Oct 25 '12 at 5:57

2 Answers 2

It looks like you might be using R. If that's true, you can use this from visual:

[sourcecode language="r"]
function foo() {
     $var = "bar";
}
[/sourcecode]
share|improve this answer
1  
I believe that shortcode is native to WP.com but not to stand-alone WP installs... –  Johannes Pille Jun 7 '13 at 12:34
    
Nope it's PHP, not R. –  canadiancreed Jun 7 '13 at 22:13

Try SyntaxHighlighter Evolved. I believe it will work for your needs.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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