Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm a software developer and I've started my first blog on Information Technology. Since I'm using wordpress (hosted free plan) as blogging platform, I'm wondering if there's a fast and useful way for styling code snippet in my posts.

share|improve this question

migrated from writers.stackexchange.com May 1 '11 at 16:53

This question came from our site for authors, editors, reviewers, professional writers, and aspiring writers.

2  
Not a clue what this has to do with writing. We're not a styling or coding SE. –  Ralph Gallagher May 1 '11 at 2:49
    
Dear friend, before posting here I've read the policies (faq) about what kind of questions are accepted here. If you didn't, please take a look at it. If I'm not wrong, technical questions and professional blogging topics should be fine with the policies. –  Francesco R. May 1 '11 at 9:14

4 Answers 4

Wrap the code in the <code> or <pre> tags, depending on whether it's an inline snippet or a block of code.

Also, search the web for "wordpress syntax highlighter," which will tell you about several wordpress plugins that can color and style code elements for various programming languages.

Finally, the Wordpress StackExchange site will probably have some great answers for you: http://wordpress.stackexchange.com/

share|improve this answer
    
Thank you so much Dale! Using the <code> tags is right to me, but I should define the colors of each reserved words. I will search the web for some useful plugins that works with some programming languages. Thanks. –  Francesco R. May 1 '11 at 9:21

I prefer WP-Syntax plugin for styling code snippets it also supports many programming languages such as PHP, Bash scripting, etc. There are also many other WP-Syntax Plugins to help with styling, visiaul editor support, etc.

WP-Syntax (Basic Plugin) WP-Syntax Colorizer (Styling Plugin)

share|improve this answer

I use Wordpress, and I use SyntaxHighlighter Evolved for formatting code on my blog. It's very simple to use, and has support for a wide variety of styling languages. It also has support for different colour schemes I believe (although I have not used it myself).

share|improve this answer

If you use free wordpress without ability to install plugin, you can use online free service to convert your code into styled HTML called Quick Highlighter

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.