Support

Account

Home Forums General Issues textarea creates extra tags

Solved

textarea creates extra tags

  • I’ve seen some old posts on here related to this, however, I saw comments mentioning that the fixes no longer work. I have some textareas with ACF at the moment which insert their own tags, this conflicts with the p tags I surround the php with which doesnt register my styling.

    In my template, I have:

    <?php if(get_field('about_company')): ?>
       <p class="description"><?php echo get_field('about_company'); ?></p>
    <?php endif; ?>

    What I see in my sourcecode on the frontend:
    <p class="description"><p>some text here</p></p>

    Obviously, the inner p tags disassociate the styling in the outter p tags. I have used strip_tags but that distorts the formatting for the content which I dont want.

    I also noticed theres a field for ‘width%, class, and ID’. I put ‘description’ inside the class field but it doesnt populate with the p tag. How can I fix this?

  • What version of ACF are you using? 4 or 5?

  • What do you have New Lines set to in the field settings. It should be either “No Formatting” or “Automatically add <br>”

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘textarea creates extra tags’ is closed to new replies.