About MeArchivesHow TosWhat Is?Generate CashCase StudiesMediaResourcesMy SitesAdvertiseNewsletterContact

Testing WP_CodeShield

June 10, 2010

Miscellaneous

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.

About Keith Lock

Keith has been in the affiliate marketing field for 10+ years working in a variety of niches along the way. His extensive technical background has allowed him to gain a significant advantage while marketing online. Keith primarily writes detailed step-by-step guides and product/service reviews in the make money online niche.

View all posts by Keith Lock

© Earn A Living Online in Your P-Jizzle's.

Subscribe

Subscribe to get alerted by e-mail when a new article is added.

Get Exclusive Money Making Tips:

Market Samurai Free

No comments yet.

Leave a Reply