You're browsing: KeithJamesLock.com » Blogging » Blog article: Testing WP_CodeShield
Bookmark and Share

Testing WP_CodeShield

Thu, Jun 10, 2010

Blogging

I find that more and more on this blog I am displaying code in posts. To be honest I never really knew how to do it properly so in the interest of time I would just create an image with code snippets, or link to an external text file. I don't like either method. I'd prefer to show the code within the posts and allow it to be copy-n-pastable.

I found this post just now which discusses displaying code in WordPress posts. It says you can manually convert angle brackets to character entities. It also talks about some plugins, one in which will convert the brackets, etc. for you when you wrap them in code tags. So, here's my live test of WP_CodeShield...


<strong>This better not be bold</strong>
<em>This better no be italicized</em>

<?php
$testvariable = 'Might as well test if I can display php code as well';
echo $testvariable;
?>

Results:

Well.. clearly it worked. I like how the plugin converts the code within the post just one time rather than converting on-the-fly for each view. That way it is not dependent on the plugin to work after the initial conversion. And it really beats doing the conversions manually.

Related posts:

  1. phpBay Pro: The Extended Manual – Testing
  2. phpBay Pro: The Extended Manual – Introduction
  3. Review Site With eBay Auctions And Customer Reviews

Bookmark and Share

© Earn a living online in your pj's

Share this post:
http://keithjameslock.com/wp-content/plugins/sociofluid/images/digg_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/reddit_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/delicious_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/technorati_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/google_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/myspace_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/facebook_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://keithjameslock.com/wp-content/plugins/sociofluid/images/mixx_48.png

If you enjoyed this post, make sure you subscribe to my RSS feed!

 

Enter your first name and email address below to receive exclusive money making tips.
First Name:
Your Email:
Spam protection; double opt-in:
Using AWeber Autoresponder
 


$1.99/mo Web Site Hosting Sale at GoDaddy.com!

Leave a Reply