You have some code you want to talk about, and it looks like this in your favourite text editor.
So all you need to do now is copy and paste it into a blog post, right?
var ExternalLinks =
var extLinks = $(“.external”);
Trouble is, the blog post tries to interpret the code, so chunks won’t show up in the post output. You could double backtick each line
<token> will show up as text, but the presentation leaves a lot to be desired.
Plugins to the rescue.
Search the repository for syntax coloring
You can see that WP-Syntax has been downloaded 275,186 times. The splash screen looks like this:
This is a bit vanilla for me. You do have some options with this plugin. You can turn on line numbering, turn it off or choose something other than ‘1’ to start your line numbers off.
You can see that there are quite a few settings, if you scroll down the GitHub page.
You can also change themes. In the WordPress Editor, you need to block out your code.
Click on the Crayon button in the editor
Add your code, and chose your theme and other settings
And you get this: