Simple Code Snippets

If you’re someone that posts code in your posts now and then you have probably been looking for a nice Syntax Highlighter, or atleast something that didn’t mess up your posts. I was looking for the same but didn’t like all the heavyweight syntax highlighters, which sometimes didn’t even encode things the right way so I had to do things manually.

That’s why I decided to write a quick plugin for this, that shows your code (any code) like the WordPress Codex does. Simple, clean and very lightweight. The plugin uses just 10 lines of code, but does a perfect job.

To use this plugin you just have to wrap your code inside [ code ] and [ /code ] shortcodes. Here is an example of what the output look likes.

<?php

//The Query
query_posts('posts_per_page=5');

//The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();
..
endwhile; else:
..
endif;

//Reset Query
wp_reset_query();

?>

You see? No encoding yourself, and you can use <?php and other stuff just fine. It’s also easy to copy for others, which isn’t always the case with most of the syntax highlighters that are out there.

Actions

To download Simple Code Snippets, head over to the WordPress repository page for Simple Code Snippets.

If you want to ask a question, submit a bug or request a new feature, do so in the support forums for Simple Code Snippets

In order to continue development of Simple Code Snippets, consider donating $10, $20 or $50. This donation will be used to improve Simple Code Snippets

Pallet Tafels