Support » Fixing WordPress » mystery p tag
mystery p tag
-
why is wordpress generating paragraph tags when i insert html into pages?
on my home page within these elements there are empty <p> under each div that are being generated by wordpress and not my programming.
div class="entry-content"> <div id="mid-content"> <p></p> <div class="container marketing"> <p></p> <div id="map"> <p></p>
this is causing a problem primarily on the last div containing the google map. i want that to sit flush with the footer but because of the <p> there is a line break. how do i stop this from happening?
thanks
-
Are you switching between editors?
Hi Andrew – Nope. Only using text editor.
Does the same thing occur with all plugins deactivated & one of the default themes active?
I”ve tried deactivation on all plugins. That doesn’t change anything.
Do you have extra spaces between the lines where the <p>’s are being inserted?
can you cut and paste the html code you are pasting exactly as it is in the editor?
and post a link to that page here.
the issue is on every page but you can best see what i’m talking about on the home page – http://macrodiver.com — again because of the additional <p> tag the map div is not flush with the footer
copied from the editor
<div id="mid-content"> <div class="container marketing"> <h2 class="mid market"><span style="text-decoration: underline;">Our Divers</span></h2> <p>"We planned to do our open water here and loved the diving and the company so much we stayed for 3 weeks"</p> </div><!-- end of container marketing --> </div><!-- end of mid-content --> <div class="container marketing"> <div class="lower-content" style="margin-top: 20px;"> <div class="span6"> <h2 class="mid market">Gili Trawangan</h2> <p>The Gili islands are an archipelago of three small tropical islands. Located near Bali, Gili Trawangan has is a popular tourist destination. Beautiful crystal clear waters and white sand beaches have attracted people from all over the world and with a vibrant nightlife and wide range of accommodation, the Gili islands are a perfect holiday vacation destination.</p> </div><!-- end of span6 --> <div class="span6"> <h2 class="mid market">Dive with us</h2> There is no better way to spend your time on the Gili islands than in the water. Whether it's your first time or you're an experienced diver we are here to make your time in Indonesia truly amazing! </div><!-- end of span6 --> </div><!-- end of low content --> </div><!-- end of container marketing" --> <div id="map"><iframe style="border: 0;" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d31579.65752808906!2d116.05770025687528!3d-8.35660430578005!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2dcde0ab4ff1579f%3A0xfcea7c174732d4b2!2sGili+Trawangan+Island%2C+Gili+Indah%2C+Pemenang%2C+North+Lombok!5e0!3m2!1sen!2sid!4v1410236859012" width="100%" height="350" frameborder="0"></iframe> </div><!-- end of map -->
Is it because some text isn’t in paragraphs?
Can you try and remove your html comments? All of them, and see if it makes a difference? And post a link to that page when you’re done, please?
I think you should remove the p tags, too. Just use the tags for other than p’s.
Andrew – added the paragraph to that last bit of text. That didn’t change anything. Then as Janet suggested removed all paragraphs and that didn’t do anything.
Is it possible it’s somewhere in the index.php for some reason? I can’t think why else it would be appearing on every page unless it’s either a problem with WP or strangely coded into the theme itself.
Did you remove all the comments from your code?
just did that… if you’re looking now you can see. it did remove the paragraphs but of course destroyed the layout. so it has to be a problem with the text editor
Are you saying the HTML comments were formatting your page?
yes
can you try pasting the code into your editor exactly like this?
<div id="mid-content"> <div class="container marketing"> <h2 class="mid market"><span style="text-decoration: underline;">Our Divers</span></h2> "We planned to do our open water here and loved the diving and the company so much we stayed for 3 weeks" </div> </div> <div class="container marketing"> <div class="lower-content" style="margin-top: 20px;"> <div class="span6"> <h2 class="mid market">Gili Trawangan</h2> The Gili islands are an archipelago of three small tropical islands. Located near Bali, Gili Trawangan has is a popular tourist destination. Beautiful crystal clear waters and white sand beaches have attracted people from all over the world and with a vibrant nightlife and wide range of accommodation, the Gili islands are a perfect holiday vacation destination. </div> <div class="span6"> <h2 class="mid market">Dive with us</h2> There is no better way to spend your time on the Gili islands than in the water. Whether it's your first time or you're an experienced diver we are here to make your time in Indonesia truly amazing! </div> </div> </div> <div id="map"><iframe style="border: 0;" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d31579.65752808906!2d116.05770025687528!3d-8.35660430578005!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2dcde0ab4ff1579f%3A0xfcea7c174732d4b2!2sGili+Trawangan+Island%2C+Gili+Indah%2C+Pemenang%2C+North+Lombok!5e0!3m2!1sen!2sid!4v1410236859012" width="100%" height="350" frameborder="0"></iframe> </div>
Yes! That removed the empty paragraphs. So it is just the comments that was causing the problem?
thanks a lot for the help
- The topic ‘mystery p tag’ is closed to new replies.