WordPress SyntaxHighlighter Plugin Highlight Range Work Around

Screen Shot 2014-11-26 at 8.37.07 AM I love the SyntaxHighlighter plugin which allows me to showcase my code. I also love the options available, especially the one I use for highlighting certain lines of the code.

Today I was writing a post and wanted to highlight a range of lines – lines 3 through 7. I assumed I could just use this:

[[code lang="php" highlight="3-7"]]

It didn’t work. It only highlighted line 3. I looked at the documentation in Settings->SyntaxHighlighter on my dashboard, and it says, “A comma-separated list of line numbers to highlight. You can also specify a range. Example: 2,5-10,12.”

So I tried this:

[[code lang="php" hightlight="3,4-7"]]

And it worked! You’re welcome! 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top