there isnt a single question mark in that post. Just like this one.
Depending on where the unclosed <p> tags appear this may be a stupid question, but might it be your single.php theme file?
The <p> tags are appearing “within” the post content. So anything that would be printed via the the_content() function is getting this odd treatment.
Here is the way the code shows up in the visual WordPress editor, even when “use visual editor” is turned off in my profile, AND this is how the raw data appears in the database when I look in the table wp_posts…
<div class="banner-block">
<h1 style="text-align: left;">News Post Originally Appeared On...</h1>
<a href="http://feeds.feedburner.com/gamertell?format=xml" target="_blank">
<img src="http://www.thegeekmedia.com/assets/img/banners/blogs/1.jpg" alt="" width="225px" height="50px" />
</a></div>
The above is valid and is how it is supposed to look. Below, however, is how it shows up in the View Source of a web browser and how the W3 Validator is reading it.
<div class="banner-block">
<h1 style="text-align: left;">News Post Originally Appeared On...</h1>
<a href="http://feeds.feedburner.com/gamertell?format=xml" target="_blank">
<img src="http://www.thegeekmedia.com/assets/img/banners/blogs/1.jpg" alt="" width="225px" height="50px" />
</a></div>
Now this is only a snippet of the code, but it is also where the invalidations start. The <p> tags get inserted for no reason and on top of that are not even closed properly.
Now, as for my question which I felt what quite obvious: How do I stop WordPress from inserting these tags?
Your two code examples look exactly the same to me.
I’d recommend redesigning your theme so that you are not inefficiently having to paste the above banner code into every post. Otherwise if you don’t want paragraphs or line breaks inside pasted code, a way to help prevent it is to have your pasted code all on one line (no line breaks in your code).
sorry, i see what happened with the above code post. here is what should have appeared in the code block…
<div class="banner-block">
<h1 style="text-align: left;">News Post Originally Appeared On...</h1>
<p><a href="http://feeds.feedburner.com/gamertell?format=xml" target="_blank">
<p> </p>
<p><img src="http://www.thegeekmedia.com/assets/img/banners/blogs/1.jpg" alt="" width="225px" height="50px" />
</a></div>
The banner gets added to each of my posts via the WP-O-Matic plugin for pulling content from blogs that are affiliated with my own blog/website. When WP-O-Matic initially generates the post, everything appears fine and dandy. It is if I go into the post via the WordPress editor that everything goes wonky and all of these rogue <p> tags get tossed in for seemingly no reason.
It may be an issue with how the plugin works. Try making your auto-inserted code all on one line.