Skip Navigation

[Résolu] Empty P tags being added to the live page

This support ticket is created Il y a 3 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Marqué : ,

This topic contains 11 réponses, has 2 voix.

Last updated by JorgeE7101 Il y a 3 années et 1 mois.

Assisted by: Jamal.

Auteur
Publications
#1993743
Screenshot 2021-03-19 at 17.25.05.png

Hello. I have to come back to this question

https://toolset.com/forums/topic/empty-fields-adding-blank-space-to-the-live-page/#post-1993729

It worked fine until the last update.

Now, I'm getting empty spaces again in the live page. It seems it is outputting empty P tags for conditional fields. How can I fix it? Thanks.

#1994263

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

To better assist you with this issue, I need to check how the view or the content template is set. Would you allow me temporary access to the admin area to check it further? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

Please let me know what view or content template you are working on? Share a URL and a screenshot where I can see the issue.

#1996417

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for preparing this stage site. Unfortunately, the WordPress credentials are not working for me. I am able to pass the first basic HTTP auth, but I can't log in to WordPress. Can you double-check if the credentials are working for you?

#1996425

Hi Jamal,

I’ve updated the login details.

Could you please check now.

Thanks.

#1997307

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Jorge! Unfortunately, the credentials are still not working for me. Check this screencast hidden link

I am setting your next reply to be private. Please test the user/password from your side to make sure they are working.

#1997523

Hi Jamal,

I've checked and tested it now, so it should be fine. Could you please try again with the same details?

Thanks.

#1997671

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you! I was able to login.

Honestly, I think that the following code is a misuse of the wpv-auto shortcode:

[wpv-autop]<p>Something</p>[/wpv-autop]

Because it will try to add <p> tags, using wpv-autop, to a content that is already having <p> tag. Instead use one of the following lines:

[wpv-autop]Something[/wpv-autop] 
<! -- or -->
<p>Something.</p>

Now, let's take the "texto-da-atraccao-turistica-4" field as an example. It is a WYSIWYG field. It will generate <p> for each line, especially for double line breaks. Instead of:

[wpv-autop]<p>[types termmeta='quando-visitar-texto-do-destino' output='raw'][/types]</p>[/wpv-autop]

Just use:

[types termmeta='quando-visitar-texto-do-destino' output='raw'][/types]

The "quando-visitar-texto-do-destino" field is also a WYSIWYG, you are using the output='raw' argument, which will disable the generation of <p> tags for each line. Just remove the argument from the shortcode and you can drop the wpv-autop too:

[types termmeta='quando-visitar-texto-do-destino'][/types]

Check the available arguments for the WYSIWYG field here https://toolset.com/documentation/customizing-sites-using-php/functions/#wysiwyg

I hope this helps. Let me know if you have any questions.

#1997679

Thanks. I've kind of suspected that was the case on those pages, so I've followed what you've said and it's fixed on those pages.

However, if you check any blog post I also have the same issue.

There is an extra P tag after the h1 and another one just before the main blog text.

And I've checked the template and I can't find any [wpv-autop] in there.

I also use a template for the blog posts. It's called home/blog.

Could you check this as well?

Thanks.

#1997727

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I believe that the empty tags on the single posts page and on the home archive do not really come from Toolset.

On the archive template, they come from a <p> tag that expects the excerpt of the post. And no posts have any excerpts. The excerpts are by default enabled, only for pages. Check this screenshot hidden link

On the single post page, I think that they come from the theme's template. The empty <p> tags are outside of the content template's result(rendering). Check this screenshot hidden link

As a workaround for both cases, you can add the following Javascript code to the content template and the archive. It will remove all empty <p> tags:

jQuery(function($){
  $('p:empty').remove();
});
#1997795

Thanks.

It seems that this has been caused by WordPress 5.7. I'm no the only one having the issue

https://wordpress.org/support/topic/empty-spaces-after-wordpress-5-7-update/

For a temporary fix I'll use a CSS line, but it seems it will be reverted in the next deployment of wordpress.

body p:empty:before {
content: none;
}

PS - Could you please remove the images/screenshots or hide them from public view?

Thanks again.

#1997809

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+01:00)

The CSS fix seems to be a good workaround too. Thank you for sharing this issue's report.

The images and the links remain private. Only you and our team can see them, no other users can. Check this screenshot from an incognito window https://toolset.com/forums/topic/empty-p-tags-being-added-to-the-live-page/ Also, other clients won't be able to see them too.

#1997825

Thanks for your support Jamal. My issue is resolved now.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.