Skip Navigation

[Resolved] Using shortcodes in between text

This thread is resolved. Here is a description of the problem and solution.

Problem: I have two shortcodes that hold integers, and I would like to display some static text between the two custom fields.

Solution: You can place static text between Types field shortcodes.

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by barryG-4 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1233862

I am trying to: Inside an Elementor template page for a custom post type I want to display two Toolset custom fields right next to each other. They are 'feet' and 'inches'. In between them I want to add 'ft' so the displayed output would read for example 5ft 6.

The following html and two shortcodes in a shortcode module shows this: Height: 56

Height: [types field='height-feet'] [/types][types field='height-inches'][/types]

So is it possible to add text in between the shortcodes somehow. I tried the following but it doesn't work:

Height: [types field='height-feet']ft [/types][types field='height-inches'][/types]

So html before is fine but not in-between. Is there something I can do to add html in between the two shortcodes?

Link to a page where the issue can be seen: hidden link

I expected to see: Height: 5ft 6

Instead, I got: Height: 56

#1233975

You can place the "ft" text between the two shortcodes, but not inside either shortcode, like this:

Height: [types field='height-feet'][/types] ft [types field='height-inches'][/types]

However, depending on the space available to show the text this could break to more than one line. I would have to see it breaking in the browser to make a good CSS recommendation.

#1233986

Hi Christian,

I can see my stupid mistake now. I thought I was adding the ft in between the shortcodes but I wasn't....Thank you so much and it works perfectly of course now.

Many hnaks,
Barry.

#1233987

My issue is resolved now. Thank you!