How to publish your code snippet in WP post

I must say right away I’ve found one WP shortcoming so far – you just can’t type a code snippet to show it properly as a snippet in your post.
So after a while I figured: wrap your code snippet both in code tag and pre tag. Code tag with square brackets, pre tag – as the ordinary HTML tag.

This is bytesize post – tutorial but it will save you the time you spend on looking all over the web on how to post just few code lines!

And – every time you edit your post, it will kill your snippet so you rather write a new post but don’t touch the one with your nifty snippet! Pffff…

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s