Skip Navigation

[Resolved] Divi theme, having trouble using custom field shortcode in code module

This support ticket is created 2 years, 11 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by WilliamM1564 2 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2299253

Tell us what you are trying to do?
I am trying to use custom field shortcodes in Divi code module.

Strangely, I can confirm that the shortcode is working, but when I use it inside the code, shortcodes seem to be returning empty strings.

At the following page, I have tried a few things to debug the issue.

The code should generate a Call Now button.

The first attempt (showing a broken image) is done inside a code module.

Second attempt is shown inside a text module (under text).

Third "attempt" is shown inside a text module (under visual so I can see the code generated). Sometimes this shows values coming through, sometimes it does not.

Fourth "attempt" simply returns the value of the cid field so confirm that the shortcode is working properly. This always works.

hidden link

Is there any documentation that you are following?
No.

Is there a similar example that we can see?
The identical code works perfectly inside a Toolset view, here hidden link

What is the link to your site?
hidden link

#2299853

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share admin access details so I can check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2300845

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The thing is that Toolset offers limited integration with Divi builder and when it comes around using nested shortcode or shortcode within the quotes it usually breaks the output.

The workaround is, I've created the following content template and moved the following code you added to Divi Text module to this content template:
=> hidden link

[php]
 <a href="<em><u>hidden link</u></em> field='cid'][/types]&linker=[types field='linker'][/types]" target="_blank" rel="nofollow noopener"><img src="<em><u>hidden link</u></em> field='cid'][/types]&stat=2161" alt="Call Now"></a>

[/php]

Then, I've added the content template shortcode to your Divi template's text module as given under:

[wpv-post-body view_template="template-for-call-button"]

I can see the button working at tope: hidden link

#2300889

My issue is resolved now. Thank you!