How to insert Html code block in WordPress blog po

2019-06-06 16:51发布

I had written a blog post in WordPress and checked its preview before publishing and noticed a strange format change in the html code I have added in my blog post, converting (encoding) the < and > characters into their (&lt) and (&gt)

Is there any plugin I can add for displaying the code as it is?

2条回答
三岁会撩人
2楼-- · 2019-06-06 17:31

I replaced < character with a special character 〈 and > character by 〉 just to prevent rendering my HTML code in my blog.

查看更多
做个烂人
3楼-- · 2019-06-06 17:34

After a long research and help from my seniors I got this solution for restricting the WordPress from converting (encoding) the < and > characters into their (&lt) and (&gt):

You can use:

<pre class="lang:html decode:true ">
 /*Some Html code here*/
</pre>
查看更多
登录 后发表回答