Skip Navigation

[Resolved] Content Template Code Editor adds extra and tags when clicking update.

This support ticket is created 3 years, 11 months ago. 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.

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: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by amjadM 3 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1963613
Screenshot 2021-02-23 114716.jpg

I am trying to:
I have looked everywhere but I cannot find a clear solution. I have a content template that loads data from multiple shortcodes and when I am editing the code in the Toolset Content Template Code Editor, when I click on the Update button, it automatically adds paragraph <p> tags and some times <br> line break tags all by itself. If I remove these tags and hit Update again it adds them again. I have looked through all sorts of documentation, but there seems to be no clear solution at the present.

I am using Divi 3.9 at the moment, and am thinking of switching over to Astra theme to save myself the headache of compatibility issues between Divi and Toolset. That said, I need a solution for this issue because it appears in multiple places in many content templates.

I am using the Block Editor as my default editor.

See attached image for reference.

Link to a page where the issue can be seen:

I expected to see:

Instead, I got:

#1963705

Hello,

I suggest you check these:
1) In the content template, use the WP built-in shortcode block to setup your shortcodes, see WP document:
https://wordpress.org/support/article/shortcode-block/

2) When you display above content template, add attribute suppress_filters='true' into content template shortcode, for example:

[wpv-post-body view_template='my-ct' suppress_filters='true']

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body
If suppress_filters=’true’, all third party (non WordPress) filters hooked into the_content filter will be removed

#1965517

My problem is that I have a content template that is assigned to a CPT via the WordPress GUI.

Nowhere in the code of my content template do I have the [wpv-post-body... shortcode. Is there a way I can add a code snippet or modify my functions file with specific code? The extra html tags seem to be triggered by javascript when I click on Update.

Perhaps something like:

<?php remove_filter( 'the_content', 'wpautop' ); the_content(); ?>

#1966159

You can try the [wpv-noautop] shortcode, see our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-noautop
This shortcode disables the auto-paragraph feature for content placed within it.

#1993929

I ended up finally just changing themes from Divi to Astra and the problem was solved. There just was no other way to work my way around this big issue.