Support

Account

Home Forums General Issues Using a shortcode in a text module

Solving

Using a shortcode in a text module

  • Hi,

    I’m using a shortcode for a phone number, amongst other things, within text fields however there’s an added linebreak I cannot get rid of.

    I’d like the shortcode contents to appear ‘in-line’

    Edit: This appears to happen with WSIWYG and not a number field.

    Is there something I need to add to functions.php to prevent this happening?

    Thanks.

  • You should use do_shortcode().

    Just wrap all your content inside this function.

    change:

    the_field('my_text');

    to:

    echo do_shortcode(get_field('my_text'));

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

You must be logged in to reply to this topic.