Display HTML Code in Wordpress Post
In Wordpress posts if we write any HTML codes in Text editor, the code will not be displayed. Instead of code, Wordpress, sends the HTML code as it is. The web browser compiles the code to display its output. Hence the code will not visible to the reader. To avoid this, follow these steps- Write code in visual editor.
- Select the code.
- Change format to 'preformatted'
Decode HTML Tags for Pre/Code
The alternate method is to use online HTML decode services available. Google for HTML decode and you will get many matching online decoders. Then follow these steps.- Copy paste your HTML or Javascript code to decoder.
- Get it decoded.
- Copy the resulting HTML code.
- Paste it in text editor.
- Wrap it with <pre> tag