[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.
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?
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:
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:
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: