1

Ok, I have read and followed the instructions as written in this link: http://en.support.wordpress.com/code/posting-source-code/

I have tried all other the solutions, including reinstall the whole wordpress site, installing syntax highlighting plugins etc. but it just din't work ?! Below is my published post in Twenty Thirteen. My post still display the code block as plain text as you can see.

My post still display as plain text

Edit: I'm using self-hosted WP and installed (and activated) SyntaxHighlighter Evolved

It worked with single line code, but below is what it showed when I typed multiple lines of code:

enter image description here

2
  • The shortcode works on .com blogs only, it is provided by a plugin.
    – fuxia
    Nov 21, 2013 at 21:32
  • 1
    yes, yes, I mean I'm using my self-hosted WP blog and I also installed SyntaxHighlighter Evolved
    – philomath
    Nov 21, 2013 at 21:36

1 Answer 1

2

Since you are self hosting the blog, you will need to:

  1. Install the SyntaxHighlighter Evolved plugin.
  2. Make sure that you enable the plugin on your blog (this is not done automatically after install).

You should now be able to add the code to a post or page via either the visual or text editor.

[code language="css"]
your code here
[/code]
3
  • Thanks, but it just din't work with multiple lines, ie: [code language="css"] your code here 1 your code here 2 your code here 3 [/code]
    – philomath
    Nov 21, 2013 at 22:01
  • Check that WordPress hasn't inserted a non-breaking space ( ) before the closing code tag. If so, try removing it.
    – block14
    Nov 21, 2013 at 22:27
  • Thanks, I will try that sometimes but now I switch to another plugin and it works!
    – philomath
    Nov 21, 2013 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.