WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

closed as off-topic by Wyck, Michael, Pieter Goosen, cybmeta, birgire Mar 3 '15 at 9:30

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers' support routes." – Pieter Goosen, cybmeta
  • "This question does not appear to be about WordPress within the scope defined in the help center." – Wyck, Michael
If this question can be reworded to fit the rules in the help center, please edit the question.

Try and Google "syntax highlighter wordpress plugins". – Wyck Oct 25 '12 at 5:57

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

share|improve this answer

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";
share|improve this answer
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

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