Tag Archive for 'plugin'

24
Oct

Posting Source Code in WordPress

Just when I was posting source code in my previous post, I realised that my newly installed wordpress does not format the source code nicely. (Read: I’m new to WordPress!)

Nevertheless, I google out and finally able to post source code in my blog.

Here’s how.

  1. Download Plugin: Go to SyntaxHighlighter Plugin Page and download the plugin
  2. Upload Plugin: Extract all files from the ZIP file, making sure to keep the file/folder structure intact, and then upload it to /wp-content/plugins/.
  3. Activate Plugin: Go to the admin area of your WordPress install and click on the “Plugins” menu. Click on “Activate” for the “SyntaxHighlighter” plugin.

And here’s how to use it

When creating a new post, toggle to HTML view.

If the source code you want to use is in javascript, type…

["language"]alert(‘hello world’);[/ "language"]

in that view.  Replace the above “language” with the language of your choice. In this case, it is replaced with “javascript” (For full supported language, visit author website.)

And it should display like the below.

alert('hello world');
VN:F [1.9.3_1094]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)



Search Website

Sponsored Ads

Sponsored Links

Sponsors

Sponsors

About Me

Me

Hello, Im Benny Chong. This blog is a proof that I have too much spare time to burn. 

I will be writing topics mainly on web design, application development, photography and other rubbish. Cheers