Skip to content

August 7, 2014

Using a Syntax Hilighter With WordPress

by noise

If you’ve just published your first WordPress Blog and you want to post properly formatted source code examples you will neet do install a syntax highlighter plugin.

We will use wp-syntax plugin. Login to your WordPress admin account then:
– go to Plugins -> Add New
– search for: wp-syntax
– press Install now

Then you will need to add your FTP login (username and password) in order for WordPress to install the plugin.

Tip: If you want to remove alternative background lines coloring (which is kind of annoying), then edit the following file (the css of the plugin): wp-content/plugins/wp-syntax/css/wp-syntax.css

go to section .wp_syntax td.code and remove the following lines:

background-color: #EEE;
background-image: -webkit-linear-gradient( transparent 50%, rgba(255, 255, 255, .9) 50% );
background-image: -moz-linear-gradient( transparent 50%, rgba(255, 255, 255, .9) 50% );
background-image: -ms-linear-gradient( transparent 50%, rgba(255, 255, 255, .9) 50% );
background-image: -o-linear-gradient( transparent 50%, rgba(255, 255, 255, .9) 50% );
background-image: linear-gradient( transparent 50%, rgba(255, 255, 255, .9) 50% );

and add the following lines:

background-image      :none;
background-color      :none;

then go to section .wp_syntax pre and change:

background           : transparent !important;

to:

background           : #FCFCFC !important;
Read more from Noise

Leave a Reply

required
required

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments