The AL2 Blog

February 24, 2010

Code Highlighting in WordPress

Want to know how to highlight programming code on your website?

A great JavaScript plugin to do this for you (and for me) is Syntax Highlighter. This is exactly how I will be demonstrating code samples on this site.

  //Here is a PHP Code Sample
  echo "This is some sample PHP code";
  echo "It is to demonstrate syntax highlighting";

Integrating into WordPress

It’s not actually any more difficult than integrating into any other site. For example, here is the code I used for the demonstration above.

	<pre class="brush: php;">
		//Here is a PHP Code Sample
		echo "This is some sample PHP code";
		echo "It is to demonstrate syntax highlighting";
	</pre>

You will also need to have included the relevant CSS files in your header. To make the magic happen, you also need to make the javascript call in the page.

// On DOM load
$(function()
{
	SyntaxHighlighter.all();
});

Easy as that!

Filed under: Development,Programming — Tags: , — Andy Long @ 6:53 pm

February 22, 2010

Welcome to the new AL2 website

The AL2 website has finally arrived.

If you’re looking for website development in the Cincinnati area, or further afield then look no further.

Have a look through the portfolio, or check out some demos of the features we can check out on our demo page.

We will also be updating the blog with news and features, and covering technical issues to help out and converse with the developer community.

Please get in touch with any feedback.

AL2

Filed under: Development,Freelancing,Programming,SEO — Tags: , , , , , , — Andy Long @ 8:40 pm

Powered by WordPress