I try to add this HTML inside a WordPress page in Text tab:
<div class="homepage-section-row" style="margin-top:5px">
<a href="#">
<p>Test</p>
<span class="icon-comment-alt fblock-icon"></span>
</a>
But when I see the page source, I see some extra tags:
<div class="homepage-section-row" style="margin-top:5px">
<a href="#"><p></p>
<p>Test</p>
</a><p><a href="#"> <span class="icon-comment-alt fblock-icon"></span><br>
</a>
</p></div>
I’m using WordPress 4.1. What should I do?
In WordPress text editor, any block level like
<div>
<p>
<ul>
elements will be reserved, any inline elements like<a>
<span>
will be automatically wrapped in to<p>
tags if there are line breaks surrounded.What you could do is make everything one line:
OR this is also acceptable:
OR update the html tags if you want to have multiple items:
It’s called wpautop. I also find it incredibly annoying, but when you have a website with a lot of writers, it is very useful.
Here is a plugin I have used to turn it off – HTML Markup Editor