I came across an IE display issue with my portfolio recently where the divs of the individual projects were ‘staircased’ down the page, with a whitespace break of about half the height of the div between the top of the previous project and the top of the next one. It was irritating, and I couldn’t figure out what was causing it until I examined the source code that the browsers were generating and discovered WordPress was automatically inserting <p> tags around certain other tags (even in HTML view in the visual editor!), which IE was interpreting as whitespace.
A quick bit of googling came up with a couple of different solutions which I’ve listed below.
After sifting through more code than Iâ€™d like to admit, I figured out a very quick and easy fix that doesnâ€™t seem to break anything else (on my site anyway). All you need to do is open the /wp-includes/default-filters.php file and comment out the following line:
(Note: to comment out a line in a PHP file, insert two forward slashes in front of the line.)
By default, WordPress automatically inserts paragraph tags all over the place when displaying â€˜the_contentâ€™ â€“ this often gets in the way when youâ€™re trying to space out your text, and also creates validation issues (inserting implicit <p>). If you want to strip the automatically inserted paragraph tags from your content, simply insert this line in your template file above â€˜the_contentâ€™ tag:
<?php remove_filter (â€™the_contentâ€™, â€˜wpautopâ€™); ?>