Skip Navigation

[Closed] how to use types_get_field_meta_value with sized images

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 8 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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 5 replies, has 2 voices.

Last updated by Shane 8 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#304958

I am calling this api types_get_field_meta_value but it gives me the original sized image. Is there a way to use this api and get a sized image?

#304968

Shane
Supporter

Languages: English (English )

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

Hi Jason,

Thanks for contacting our support forum.

Based on our documentation here https://toolset.com/documentation/user-guides/displaying-wordpress-custom-fields/#1

You are able to supply an argument to the field you want to render using the api.

From our types field documentation on the image fields you are able to supply numerous amount of field values that you want.

See here : https://toolset.com/documentation/functions/#image

Example usage for an image size would be.

types_render_field("custom-field-slug-name", array("size"=>"medium"));

Please let me know if this was able to help you.
Thanks

#304986

I was not able to use "types_render_field". I have to use "types_get_field_meta_value" so based off of that info is there any additional parameters I can send through "types_get_field_meta_value" in order to get the image sized?

#304988

Shane
Supporter

Languages: English (English )

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

Hi Jason,

I checked the function in the types code but it doesn't seem to support additional arguments to specify the information you will like to achieve.

Sorry but this is not possible using this function.

Thanks

#305007

I tried using "types_render_field" but it would not work. the call is inside a shortcode function. When I swtiched to this "types_get_field_meta_value" it worked. I would like to use the first option if possible

#305009

Shane
Supporter

Languages: English (English )

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

Hi Jason,

In order for the types_render_field function to work it must be placed directly in the page template itself and not wrapped within a shortcode.

Example.
Add this function types_render_field to the page.php file and it would be able to render a custom field from any page that uses the page.php file.

Please let me know if this helps.
Thanks

The topic ‘[Closed] how to use types_get_field_meta_value with sized images’ is closed to new replies.