Archived

This topic is now archived and is closed to further replies.

  • 0

Unwanted empty <p></p> markup

Question

Posted · Report post

Hi,

 

I have something I can't get solved, hope I will get some good insights here.

 

I have two pages that end with a gallery from WP. In one page there is an extra empty line with <p></p> which causes extra whitespace.

Unwanted p tags >>> http://oudisnieuw.net.websrv.makeweb.nl/cafestoelen/
No p tags >>> http://oudisnieuw.net.websrv.makeweb.nl/project-winkel-horeca-inrichting/

.

The only difference I know of in the page where there are no unwanted I added some divs because of the pagelines grid system. I think I'm not the first one struggling with this, however I did not find a solution.

 

Kind regards,

 

Willem

Share this post


Link to post
Share on other sites

13 answers to this question

Posted · Report post

If you're using a shortcode for your gallery, wrap around with our [pl_raw] shortcode, this is the sole reason why this shortcode was created. The [pl_raw] stops Wordpress from adding <p></p> tags when using a linebreak.

 

So your code will look like this:

 

[pl-raw]

[gallery-shortcode]

[/pl_raw]

 

You can only use the [pl_raw]...[/pl_raw] shortcode once per page, using this should strip the <p></p> tag below your gallery.

 

Code used in the Wordpress editor - http://cl.ly/image/101i3J3k3A1I

 

No <p></p> - http://cl.ly/image/400w1g3F470y

 

Also can you please stop adding your URL address with [dot]com etc.. if you do not wish for your URLs to picked by search engines please use a service such as http://tinyurl.com/

 

Or add it via the code tags like this:

http://www.pagelines.com/
1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

Willem, 

 

James is correct, in his identification of the CSS element where the errant paragraph and closing paragraph appears.  It would seem that you may have added the gallery where a blank space existed or, hit carriage-return in error.   That would explain why it appears one place, and not another.

 

Can you tell me how you added the gallery?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Danny,

 

Also a big thank you for your efforts and a solution ofcourse.

The links were a big problem for me because I'm working on a temporary URL that should not be picked up by searchengines. Thanks for the tips, I also changed it already in this thread (with the code solution).

 

Kind regards,

 

Willem

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Rob,

 

I did a test with two totally empty pages. I included a gallery in the WYSIWYG editor and the HTML editor, both resulting in an empty <p></p> line before and after the gallery.

You can check it on both pages: 

http://oudisnieuw.net.websrv.makeweb.nl/test-2-wysiwyg-editor/ 
and 
http://oudisnieuw.net.websrv.makeweb.nl/test-1-tekst-field/.

This is really a mystery for me ;-).

Share this post


Link to post
Share on other sites

Posted · Report post

I'm still not sure how you're entering the gallery.  Is it a shortcode?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Rob, I insert it by clicking on the button just under the permalink: 'Insert media'. I use this button when am in the WYSIWYG-screen and when I'm in the HTML-screen.

The result of inserting a gallery is a shortcode which you can see in the HTML-screen. In the WYSIWYG-editor a blue field is visible where you inserted the gallery, but this correspondends with the shortcode ofcourse.

 

Hope I could clearify myself with this, if not please let me know as I'm eager to solve this problem ;-).

 

Kind regards,

 

Willem

Share this post


Link to post
Share on other sites

Posted · Report post

Willem I just did a test of inserting a gallery in two WordPress installations. 

 

One used PageLines Framework, the other Twenty Eleven, the default WP theme.

 

In both cases, there is an extra <p> and </p> inserted into the page below the gallery.  Thus I must conclude that since the gallery is actually a WordPress function, support for this must come from WordPress.  PageLines did not in any way add the extra paragraph tags.  I suspect they are there for a purpose, to allow you to label the gallery, which is one of the possible options in its settings.

 

There is no extra space, as I suspected there might be, in the Text mode.  I'd suggest therefore, that you post a question in the WordPress.org forums about this.

 

Apologies for the delays.

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

In your post html code do NOT add linebreaks, wordpress will convert them into <p>

 

so do not

do this

with your html

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

Sometimes there should be paragraphs, so that's a good thing, I just don't understand why it is addes after my gallery (the page ends with the shortcode for the gallery). There are no lines in my post html after this shortcode, so there is in my opinion nothing what wordpress can convert into <p>, but it is there :-(.

<strong><a href="http://oudisnieuw.net.websrv.makeweb.nl/images/cafestoelen-entrepot-du-vin.jpg"><img class="size-medium wp-image-802 alignright" alt="Cafestoelen Entrepot du Vin" src="http://oudisnieuw.net.websrv.makeweb.nl/images/cafestoelen-entrepot-du-vin-300x201.jpg" width="300" height="201" /></a>Cafestoelen</strong> passen in ieder interieur, van landelijk tot strak. De cafestoelen van Oud is Nieuw passen perfect in uw uw café interieur, uw lunchroom of  bijvoorbeeld uw restaurant. U kunt de cafestoelen ook gebruiken als houten keukenstoelen aan uw eigen <a title="Tafels" href="http://oudisnieuw.net.websrv.makeweb.nl/tafels/">eettafel</a>.

In onze loods vindt u <strong>veel verschillende modellen</strong> cafestoelen terug. De bekende thonet stoel staat aan de basis van de vele varianten. We hebben modellen met en zonder armleuning. Ook onze oude Belgische cafestoelen zijn uniek in zijn soort. U kunt kiezen voor dezelfde stoelen maar ook een speels effect creëren door verschillende modellen te combineren.
<h2>Cafestoelen in iedere gewenste kleur</h2>
Cafestoelen zijn tijdloos en leverbaar in iedere gewenste ral kleur. We denken graag met u mee over de inrichting van uw huis of horecagelegenheid. Op afspraak bent u van harte welkom in de loods om de cafestoelen uit te kiezen en uw wensen te bespreken.

Onderstaand treft u voorbeelden van de modellen die we kunnen leveren en foto's ter inspiratie.
[gallery type="rectangular" link="file" ids="794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820"]

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Rob, thanks for all your efforts! That you also did a test I really appreciate. I'm going to ask the question at WordPress.org.

 

Kind regards,

 

Willem 

Share this post


Link to post
Share on other sites

Posted · Report post

Anytime Willem.

Share this post


Link to post
Share on other sites

Posted · Report post

Ok the first link do you mean the gap between the gallery and the blue footer area? If so that shows in firebug that it's being created by padding on the .hentry class.

 

.hentry .hentry-pad {
    padding0 0 25px;
}
1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

Hi James B, I mean the gap between the gallery and the blue footer area, but the normal gap (link 2) is no problem and is caused by the CSS you mention, I already looked into that. However, the gap is bigger with the page from the first link. That is caused because of the unwanted P tags. Simon gave me some advice, but as you can read in my reply I don't do anything strange in my editor, so still need a solution.

 

Kind regards,

 

Willem

Share this post


Link to post
Share on other sites