Code in einer Post darzustellen ist nicht einfach und bereitet ohne passendes Plug-in oft große Probleme. Der einfachste Weg ist, den Code als “Plain Text” darzustellen.
Dazu ist es möglich den HTML-Code einfach umzuwandeln. Dies erledigt das folgende kostenlose Tool ganz einfach.
Auf Deiner POST einfach auf [HTML] umstellen und vor dem einzufügenden Code <pre> bzw. danach </pre> setzen. Dazwischen den Code einfügen.
Veröffentlichen. Fertig!
Original text in Englisch:
Adding code to your WordPress post can be easy and pain free… or it can be a huge hassle! I originally thought it would be easy enough to just add a new plugin that will allow code to be wrapped in a tag, which will output the exact text that was entered.
I unfortunately found out that many of the plugins available for this need, don’t always seem to work correctly.
If you’re going to be constantly displaying code in almost every post, you may want to try out the plugins that are available. However, if you are just going to be displaying code every once in a while, I highly recommend you use a simple text converter.
Display Code, The Easy Way
HTML Encoder is a simple form that converts all of the special characters in your code into HTML standard code. Its as simple as copy, paste, cut, and then paste. Now that is much easier then spending 30 minutes trying to get a plugin to behave.
Quelle: stateofaffairs.info