358 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
Sorry, no records were found!
Latest 7 Posts
Increasing the number of posts per page on category, tag, and archive pages in WordPress
Thu, Aug 18th 2011 24
Zero day vulnerability in many WordPress themes
Wed, Aug 3rd 2011 24
WordPress XML Sitemap Plugin Review
Tue, Aug 2nd 2011 27
How to display nicely formatted PHP code in a WordPress post
Thu, Jul 21st 2011 21
Updating Price PHP print statements in Ubercart
Tue, Jul 19th 2011 15
How to dynamically set Facebook Opengraph Meta tags in WordPress headers
Fri, Jul 15th 2011 33
Theming fields in Drupal 6
Wed, Jul 6th 2011 22
Top 10

How to display nicely formatted PHP code in a WordPress post

I’ve been struggling for a while about how to embed PHP, HTML, or CSS code into WordPress posts so that they look good and are easy to understand.

I found this list of 12 WordPress Plugins to Display and Highlight Code.

I researched a few of them and finally settled on SyntaxHighlighter Evolved, which was simple to install, easy to use with short codes, formats nicely, and seems to have a large existing user base.

In your posts, you can simply use [php] and [/php] shortcodes around your actual PHP code and it does it’s trick. You can review the plugin page for the many various types of languages/syntax that are available.

I will spare your eyes and use this for all embedded code from now on.

Jul 20, 2011
22 hits

Sorry, no records were found!
Recent Blog Posts

Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition