GeSHi WordPress Sample with Javascript

The WP-Syntax plugin allows easy insertion of code in blog posts, using GeSHi (Generic Syntax Highlighter). It supposedly supports over one hundred programming languages, including including PHP, HTML, CSS, Java, C, Lisp, XML, Perl, Python, and assembly.

For example:

   <pre lang="html" line="1" escaped="true">
   </pre>

The line=”1″ directive tells WP-Syntax to insert line numbers. For this example, to nest xml inside xml, set escaped=”true”, and use html entities.

Here is another example, this time using “javascript” for the selected language. In this case, the code is indented. WP-Syntax converts real spaces into HTML space entities, which allows you to intend code.

3 Replies to “GeSHi WordPress Sample with Javascript”

    1. Hello,Just wondering if anoyne could help. I did something stupid and started my blog using a numerical archive system, and now I’d like to change it so that the post title is part of the URL for SEO reasons. Is there any WordPress plugins that anoyne knows of that could switch it without sending Googlers to invalid pages? Maybe some sort of redirector to the correct page?Thanks.

  1. After installing php5-gd and rarsetting Apache2, I still got the same error messages. Looking thru the error logs I noticed: failed to open stream: Permission denied in /var/www/wp-admin/includes/file.php on line 348 . Line 347-8 has: $new_file = $uploads[‘path’] . /$filename copy( $tmp_file, $new_file );Ahh, more file permissions, this time on the uploads dir. Once I gave the Apache process recursive write perms to wp-content/uploads and restarted, all was good.Thanks for the tips!

Leave a Reply

Your email address will not be published. Required fields are marked *