Problem:
I am trying to: get my form to display normally with layouts template as page template. The form shortcode is in the post body. A form showing with extra p and br tags
Solution:
1. To remove extra paragraph tags, please add the following code in your theme’s functions.php file:
remove_filter( 'the_content', 'wpautop' ); add_filter( 'the_content', 'wpautop' , 12); add_filter('the_content', 'remove_empty_p', 20, 1); function remove_empty_p($content){ $content = force_balance_tags($content); return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content); }
2. You can also try [wpv-noautop] shortcode and place all your content inside this:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-noautop
Alternate solution used by the client: Formidable plugin has an option to minimize HTML. This stops the extra tags from being generated.
Relevant Documentation:
http://sww.nz/solution-to-wordpress-adding-br-and-p-tags-around-shortcodes/
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-noautop
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 |
---|---|---|---|---|---|---|
- | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | - |
- | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | - |
Supporter timezone: Asia/Karachi (GMT+05:00)
This topic contains 2 replies, has 2 voices.
Last updated by glenn 7 years, 3 months ago.
Assisted by: Noman.