I wanted to demonstrate how you can add lines of code to your blog posts (as unformatted text) using a plugin called syntax highlighter. This will help you distinguish your reflections on your code from the code itself. It’s also much easier to read!
Begin your code block with [programming-language] and end your code block with [/programming-language] (note the “/” before the name of the language). For javascript, use “js” in the square brackets. If you’re sharing GLSL code, the plugin doesn’t recognize GLSL, so use “c” instead.
//this is javascript code print("hello world");
// create a color vec4 myColor = vec4(1.0, 0.5, 1.0, 1.0); // mix two colors vec4 mixResult = mix( vec4(1.0, 0.0, 0.0, 1.0), vec4(1.0, 1.0, 1.0, 1.0), 0.5);
You can use the preview function of WordPress to test it out on your own posts before publishing.