Do you run a tutorial site? Or maybe you just want to post up a piece of code that you felt was a lifesaver? Now you can post multiple snippets of code anywhere in your page’s or post’s content with ease.
Installation
- Download the plugin, extract and upload it to your plugins folder on your server.
- Activate the plugin.
- Access the Code Library section.
- Create a new snippet and save.
- Return to the Code Library and select the “Code” link.
- Copy the code.
- Add or edit a page or post and paste the code into the HTML of the page/post where you want it to display.
- Publish or Save the page/post.
Usage
Following step 5 of the Installation instructions, you simply copy the HTML comment code and past it into the HTML of the post/page’s content. The code looks like the following:
<!–WCS[1]–>
Upgrading
If you are upgrading from version 1.0, you will see an option on the Code Library page that will
allow you to upgrade. As a precautionary measure, be sure to back up your database before doing so.
Changelog
Version 2.0
- Major overhaul of version 1.0.
- Moved code to a reusable code library so that it is no longer limited to one page/post.
- Snippets can now be placed anywhere in the post/page’s content.
- More than one snippet can be added to a page/post.
- One click upgrade feature to upgrade from version 1.
Andrew
This plugin is a lifesaver to those of us who need to post code related tutorials and snippets. Thanks for making this plugin available to the public.
September 23, 2010 at 10:14 am
Dylan
I also love this plugin. Works awesome, finally one that shows the right syntax and formatting.
January 10, 2011 at 12:40 pm
Andrew Fishwick
I think its great, thank you. It is causing some validation issues though, I am not sure if you can work around this, or if it is my issue.
I am using WordPress v3.04 and the tags are being wrapped with tags.
ie:
code example
January 25, 2011 at 10:22 am
Simon
Used to use it – but causes admin login redirects on WP 3.1.3 (ie breaks admin.)
June 1, 2011 at 10:54 pm
Allan Collins
@Simon – This blog is running 3.1.3 and it seems to function just fine. Can you give me your URL and a list of other plugins running?
June 1, 2011 at 11:06 pm
Jason
Hi Allan, just tried a bunch of plugins and your’s was by far the best. I did discover a plugin conflict with 1-click Retweet/Share/Like. Personally your plugin was far more valuable so I deactivated 1-Click.
Here’s the error:
Warning: simplexml_import_dom() [function.simplexml-import-dom]: Invalid Nodetype to import in /home/username/public_html/wp-content/plugins/1-click-retweetsharelike/la-click-and-share-fb-meta.php on line 86
Fatal error: Call to a member function xpath() on a non-object in /home/username/public_html/wp-content/plugins/1-click-retweetsharelike/la-click-and-share-fb-meta.php on line 87
June 19, 2011 at 8:08 am
Hugh Lashbrooke
Hi Allan,
I’ve been using this plugin for a while because it’s easily the best of its kind that I’ve found. There is, however, one problem that I’ve had since I first started using it. I can insert the HTML comment for the code snippet, but as soon as I switch back to the visual editor ti strips the comment out and replaces it with a non-breaking space ( ). To fix this, I’ve had to set the default view of my editor to the HTML view and make sure to never use the visual editor when editing posts that have code snippets in them.
I’m using v2.0.3 of the plugin on WordPress 3.3.2, but it was happening in older WP versions too.
This is a screenshot of all the plugins I have installed: http://hlash.me/1u – none of them seem like they should conflict or anything. Do you possibly have a work around for this issue?
May 17, 2012 at 4:59 am