Skip Navigation

[Resolved] Need help with custom field in taxonomies

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

Problem:

The issue here is that the user wanted to use a taxonomy image as the background for a divi cell and wanted to know the correct format for the shortcode.

Solution:

The correct format for the shortcode for this to work would be

This support ticket is created 6 years, 5 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 13 replies, has 2 voices.

Last updated by neilM-11 6 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1083677

Hi there,

I've setup a taxonomy for a CPT called products

I've added custom fields to this and can display basic text fields fine, and also display the full url for the image that I've setup as a custom field.

I'm using divi and would like to use the custom field image as the background for a div, but can't seem to get this to work.

I can display just the url in the body content like this:

[wpv-taxonomy-field name='wpcf-category-image']

I've displayed non taxonomy images fine in divi using the following code:

{!{types field='product-image' title='%%TITLE%%' alt='%%ALT%%' size='full' separator=', '}!}{!{/types}!}

I've tried variations on the above and looked through your support archive but I just can't get it to work.

Would it be possible to provide some code that I can drop into the divi image field to get the taxonomy image custom field to display please?

Any help would be greatly appreciated.

Thanks,

Neil

#1083809

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Neil,

Thank you for contacting our support forum.

For clarity could you send me a screenshot of where you are adding this shortcode?

Thanks,
Shane

#1083869
Screen Shot 2018-08-15 at 16.29.37.png

Hi Shane,

I'm trying to put it into the image field or background image field in Divi.

Thanks,

Neil

#1083891

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Niel,

Thank you for the clarity,

Unfortunately no the shortcodes won't work here as this option by divi builder was not designed to accept URL's from a shortcode.

Thanks,
Shane

#1083916

Hi Shane,

Thanks for getting back to me.

Custom fields do work in the image field as I have it working on other pages for example using this code:

{!{types field='product-image' title='%%TITLE%%' alt='%%ALT%%' size='full' separator=', '}!}{!{/types}!}

I just can't get the image field from the taxonomy custom field to work?

I'm guessing it needs to be encoded as above but using different content?

Thanks,

Neil

#1083985

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Neil,

You will need to confirm this with the Divi support if this actually should work or is possible.

From my point of view it shouldn't work in all cases since the field is more than likely expecting url rather than a shortcode.

But the field you have our shortcode in that works, is this an image option just like the one in the screenshot? If so could I get a screenshot of the working one settings ?

Thanks,
Shane

#1083998
Screen Shot 2018-08-15 at 20.56.30.png

Hi Shane

Yep the image works with a standard link provided by the toolset shortcodes.

The issue is that the taxonomy shortcodes don't appear in that list so I can't get the correct code to display it.

Screenshot attached of the image that works.

Thanks,

Neil

#1084047

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Niel,

So actually what you really need is the taxonomy version to getting the custom field?

Please confirm.

Thanks,
Shane

#1084048

Hi Shane

Yep that's exactly what I'm after.

Thanks,

Neil

#1084050

Please. 🙂

#1084054

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Neil,

So an example of getting the term meta would be this.

[types termmeta='category-address'][/types]

Please let me know if this helps.
Thanks,
Shane

#1084385

Hi Shane,

Unfortunately that doesn't work.

As discussed above I can get the image URL to show fine using the following:

[wpv-taxonomy-field name='wpcf-category-image']

This doesn't work when I add it to the divi image field.

What I need is an encoded version like below but using the category terminology;

{!{types field='product-image' title='%%TITLE%%' alt='%%ALT%%' size='full' separator=', '}!}{!{/types}!}

Is that possible?

Thanks,

Neil

#1084642

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Neil,

Can you regularly get the taxonomy field url with this without putting it into the url field?
[types termmeta='product-image'][/types]

If so then this should work

{!{types termmeta='product-image' title='%%TITLE%%' alt='%%ALT%%' size='full' separator=', '}!}{!{/types}!}

Thanks,
Shane

#1084644

Hi Shane

That works great thanks!

Cheers

Neil