WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Text Widget Adding P and BR tags (5 posts)

  1. Chudz
    Member
    Posted 4 months ago #

    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.

    https://wordpress.org/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 4 months ago #

    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).

  3. buzztone
    Member
    Posted 4 months ago #

    @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.

  4. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 4 months ago #

    buzztone, it might be helpful, but I wonder how many people care this function?

  5. buzztone
    Member
    Posted 4 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic