I am trying to:
Display the image with [types field='common_featured_media' ][/types]
Link to a page where the issue can be seen:
I expected to see:
the image
Instead, I got:
the linked URL
Note, the custom field 'common_featured_media' is of type 'Embedded Media' and has the value hidden link
It shows as a linked URL which when clicked, takes us to the image.
What I would like is to show the image inline on my content template I am creating with VIEWS and the BLOCKS plugin.
I just updated all the Toolset plugins so I am running the latest and still have the issue.
Hi, typically the "image" custom field type is used to hold and display static images. The "embed" field corresponds to the "embed" feaure of WordPress. It works best with 3rd-party systems like Flickr, Instagram, Vimeo and Vine ( full list available here: https://wordpress.org/support/article/embeds/ ) to display more complex content like videos and galleries. Since the URL you're referring to looks like a static image file, I suggest using an image field type.
Here's more information about the different field types, including the syntax for displaying them:
https://toolset.com/documentation/customizing-sites-using-php/functions/#embedded-media
Let me know if you have additional questions about that.
Sorry I realized that. I’m stuck with a migration from drupal using the fg drupal to WordPress migration plugin so I’ve got a database with a lot of data in this field. I think it’s mostly image data. Any way of getting it to display using views?
Many thanks
If the field information stored in postmeta is a simple URL to the image file, then you can use that raw data to generate your own image tags on-demand in your template. No conversion is needed - you can use the existing data. The syntax looks something like this:
<img src="[types field='your-embed-field-slug' output='raw'][/types]" />
The raw output type will give you access to the field content exactly as it is stored in postmeta.
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
That works in a pinch, but converting this embed field to an image field is more practical. An image field is really ideal if you want to show the image at different sizes, if you want to use native captions and alt attributes, if you want to crop and pad, if you want to be able to see a preview of the image while editing the post in wp-admin or Forms, and so on.You can manage field types in Toolset > Custom Fields > Post fields. The raw data required for an image field is a simple URL, so you would have to verify the existing information is in the proper format with no extra HTML markup. You should make a complete backup before you attempt this, in case you need to revert something unexpected. If you have created any Forms to create or edit this post type, you should edit the Form. Remove the old embed field and replace it with the new image field.
My issue is resolved now. Thank you!