# Shortcode in HTML Field breaks layout

**URL:** <https://community.gravityforms.com/t/shortcode-in-html-field-breaks-layout/12181>\
**Category:** Get Help\
**Tags:** shortcode, conflict\
**Created:** [March 15, 2022, 1:16pm UTC](https://community.gravityforms.com/t/shortcode-in-html-field-breaks-layout/12181 "2022-03-15T13:16:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gotequity](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/gotequity/32/4701_2.png) [@Gotequity](https://community.gravityforms.com/u/Gotequity)\
**Post date:** [March 15, 2022, 1:16pm UTC](https://community.gravityforms.com/t/shortcode-in-html-field-breaks-layout/12181/1 "2022-03-15T13:16:32Z")

</div>

I’m having an issue with using a shortcode in an HTML field. Regardless of where the field is placed/positioned in the form editor, the output is getting rendered as a parent div of gform\_wrapper (which makes column alignment impossible). Is this normal?

---

<div class="post-metadata">

**Author:** ![uamv](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/uamv/32/1412_2.png) [@uamv](https://community.gravityforms.com/u/uamv)\
**Post date:** [March 15, 2022, 4:12pm UTC](https://community.gravityforms.com/t/shortcode-in-html-field-breaks-layout/12181/2 "2022-03-15T16:12:16Z")

</div>

It would seem that this specific shortcode may be _echoing_ content rather than _returning_ content when running the [`add_shortcode`](https://developer.wordpress.org/reference/functions/add_shortcode/) action. I would first test with a different shortcode to see if you encounter the same. If another shortcode renders properly, then this would confirm that the issue is with the way in which the shortcode function is being run. Note from that documentation:

> Note that the function called by the shortcode should _never_ produce an output of any kind. Shortcode functions should _return_ the text that is to be used to replace the shortcode. Producing the output directly will lead to unexpected results. This is similar to the way filter functions should behave, in that they should not produce unexpected side effects from the call since you cannot control when and where they are called from.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [March 16, 2022, 6:19pm UTC](https://community.gravityforms.com/t/shortcode-in-html-field-breaks-layout/12181/3 "2022-03-16T18:19:52Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
