Show images with Url from custom field
Time needed: 4 minutes
Sometime you need to show an image from custom field. Also may you need to set an url to that image. In this tutorial, we are going to add custom field for image and url and show them in our table. We need 'Advanced Custom Fields(Acf)' plugin for this.
- Add custom field for image
We add a custom field for image using ACF. Make sure that the field type is 'Image'
- Add custom field for url
Now we need to add a field for the url. Here your custom field name has to be 'image_url' , and the field type is 'Url'.
- Take a look
If you did everything right, then you should have two custom fields, 'Image' and 'URL', in your product add page.
- Upload image and set Url
Now upload the image and set the url.
- Add a column in table
Now we need to add a new column to show that image.
- Check column
Column should checked by default, if not check it.
You can see the result in the table.