Showing codes in your WordPress is not easy.In this article,we will tell you how to display syntax highlighter code on your wordpress site.
First you need to install and activate the Synatx Highlighter Evolved plugin. After activation, you need to go Settings » Syntax Highlighter to configure the plugin settings.
We hope this article helped you find the best Display code syntax highlighter plugin for WordPress.If you liked this article you can Join us on Facebook,Twitter,Google Plus.
First you need to install and activate the Synatx Highlighter Evolved plugin. After activation, you need to go Settings » Syntax Highlighter to configure the plugin settings.
Each option has detailed description to explain what it does. Once you are done, simply click on the save changes button to store your settings.Syntax Highlighter evolved plugin uses simple shortcodes to display code. For each language you need wrap your code in the shortcode for that language.
Example:
For PHP you will wrap your code like this:
[php]For CSS you will wrap your code like this:
<?php
echo “Hello”;
?>
[/php]
[css]
.entry-title {
font-family:”Open Sans”, Times, sans-serif;
font-size:12px;
color:#FF3333;
}
[/css]
Syntax Highlighter will automatically highlight the code. It will also add line numbers and handle tab indent properly. Users will be able to easily copy and paste code snippets from your WordPress website.
How to Display Code in WordPress Without Using Plugin
you can add code by encoding the code into HTML entities.
Example:
>?php echo "Hello World"; ?<To convert code into HTML entities you can use our tool from here.After converting PHP, HTML, JavaScript code into HTML entities, you can paste them into your WordPress posts. For additional you can wrap your code between <code> and </code> tags.
We hope this article helped you find the best Display code syntax highlighter plugin for WordPress.If you liked this article you can Join us on Facebook,Twitter,Google Plus.