Text Widget Adding P and BR tags
I have created a Contact Form to go into a sidebar however when I add it into a text widget it is adding BR tags after each label and P tags around the buttons. These are not in my code and are automatically being generated. I have the check-box “Automatically add paragraphs” unchecked. I have also tried TwentyForteen theme and its doing the same thing as my custom theme.
Contact Form 7 automatically replaces newline character with BR and paragraph with P by default, so it’s a normal behavior if you have newlines there. You can disable this function by defining WPCF7_AUTOP as false (see Controlling Behavior by Setting Constants).
@takayuki – it would be very helpful for me if this default CF7 behaviour was able to be disabled on individual CF7 forms from within the CF7 interface.
buzztone, it might be helpful, but I wonder how many people care this function?
RE: I wonder how many people care this function?
I believe the problem of getting mysterious extra lines in your CF7 forms is fairly common. It is certainly mentioned at regularly intervals in posts in this forum.
I’ve personally found it is very common to get CF7 forms not displaying as I want due to extra lines being added. I can usually work around it with CSS, but not always, and it would sure be appreciated if I didn’t have to.
Also while users can disable the ‘autop’ filter by setting WPCF7_AUTOP as false in their wpconfig, that’s an area that many CF7 users are reluctant to go.
Also it’s propably more of any issue when forms are used in Widgets (where I expect Chudz is using his CF7 form) where WP does give users the option to “Automatically add paragraphs” in all Text widgets, with the default being ‘autop’ disabled.
- The topic ‘Text Widget Adding P and BR tags’ is closed to new replies.