Do you want to display code snippets on your WordPress development tutorial Posts? By default, WordPress filters out the raw code that added to posts, pages or comments. In this article, I’ll explain how to display code snippets on WordPress Posts easily.
Install and Activate the Syntax Highlighter Evolved Plugin:
Syntax Highlighter Evolved Plugin allows you to add the code snippets on your WordPress website easily without losing its formatting. The plugin uses simple shortcodes to display the code snippets on your WordPress website. Especially, if you write the blog on coding, this plugin allows you to add code snippets easily on your WordPress website.
First, you need to install and activate the Syntax Highlighter Evolved Plugin. Check this step by step guide on how to install WordPress plugins on your website.
After installing the syntax highlighter evolved plugin, navigate to Settings > Syntax Highlighter to configure the settings.
The plugin supports some smart features like
- Different color themes to highlight the code
- Display the line numbers
- Display the toolbar
- Copy/paste code
- Code wrapping
- Tab sizes
- Code title
- Starting line number (default is 1)
- Line number padding
- Tab sizes
Review all the settings and make changes as per your needs. Click on save changes in order to store the settings.