Skip to content

Show images with Url from custom field

Fazle Bari edited this page Jan 1, 2021 · 2 revisions

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.

1. Add custom field for image

We add a custom field for image using Acf. Make sure that the field type is ‘Image’

Show images with Url from custom field add custom field image

2. Add custom field for url

Now we need to add a field for url. Here your custom field name has to be ‘image_url’ , and field type ‘Url’

Show images with Url from custom field custom field for url

3. Take a look

If you did everything right than you should have two custom field ‘Image’ and ‘Url’ in your product add page.

Show images with Url from custom field take look image

4. Upload image and set Url

Now upload image and set url

Show images with Url from custom field upload image

5. Add a column in table

Now we need to add a new column for showing that image

Show images with Url from custom field add new column image

6. Check column

Column should checked by default, if not check it

Show images with Url from custom field check column image

7. Result

You can see the result in the table

Show images with Url from custom field result image
Clone this wiki locally