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.
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.
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?
Hi Jamal,
I’ve updated the login details.
Could you please check now.
Thanks.
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.
Hi Jamal,
I've checked and tested it now, so it should be fine. Could you please try again with the same details?
Thanks.
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.
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.
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();
});
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.
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.
Thanks for your support Jamal. My issue is resolved now.