Is it even possible to display HTML code in Wordpress?

I tried countless plugins, codyfying HTML with escape keys, and my blood begins to boil. Switching between Visual and HTML modes actually changes my content, that is, destroys it !!!

+8
html wordpress
source share
4 answers

OK, I figured out what to do.

  • First go to visual mode.
  • Choose Format from the formatting drop-down list. A small gray box has been created.
  • Inside the gray box, copy and paste your raw HTML.

Save it and switch from visual to HTML presentation several times. There should be no manipulation.

ABSOLUTELY CRUCIAL , which you insert into the visual tab , and not on the text tab, or it will be completely filled (very unintuitive. Will work in another way araound).

+5
source share

Wordpress does a strange thing, if you switch between visual and "text" modes (the HTML mode has been renamed to 3.5 update), it removes any tags that seem empty, which often happens. This may be what you are experiencing if I understand the problem correctly.

If you are just trying to display the code on your website, you can wrap the code as follows:

<code><p>Example code post</p></code> 

This is described here: http://codex.wordpress.org/Writing_Code_in_Your_Posts

If this is a block of code that does not need to be wrapped, you can also use the "pre" tag, for example:

 <pre><code><p>Example code post</p></code></pre> 

It’s described very well here: <code> vs <pre> vs <samp> for inline and fragmented code snippets

+3
source share

Maybe you should try this plugin http://wordpress.org/extend/plugins/insert-html-snippet/

Hope this helps!

0
source share

One way to do this is to comment out the code. Something like,

 <!--div> <md-divider class="org__meta-divider md-soc-theme"></md-divider> <h4 class="org__meta-heading">Technologies</h4> <ul layout="" layout-wrap="" class="org__tag-container layout-wrap layout-row"> <li class="organization__tag organization__tag&#45;&#45;technology">web services</li> </ul> </div--> 

instead

 <div> <md-divider class="org__meta-divider md-soc-theme"></md-divider> <h4 class="org__meta-heading">Technologies</h4> <ul layout="" layout-wrap="" class="org__tag-container layout-wrap layout-row"> <li class="organization__tag organization__tag&#45;&#45;technology">web services</li> </ul> </div> 
0
source share

All Articles