Skip Navigation

[Resolved] Trying to get image in my custom search template

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

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by puneetS-3 5 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1240256

Tell us what you are trying to do?
I am trying to create a template for my search result and I want to use a custom field image in the cards.

Is there any documentation that you are following?
I have tried all the solution that I could find on the website but couldn't actually make it work.
I am using ACF pro to generate my custom fields. I have a field with field label as Coach_Profile_Picture and field Name as coach_profile.

Is there a similar example that we can see?

What is the link to your site?
hidden link This is the page where I am trying to get the template to work.

#1240290

Hello,
It's been a while. Any update on the issue?

#1240309

Hi Puneet,

Thank you for waiting.

Since the "Coach_Profile_Picture" field that you're using is added through, ACF plugin, it returns the ID of the image and not the URL, if you'll try to call it using the Toolset's shortcode [wpv-post-field]. This is because the ACF plugin stores the ID of the image in case of the image type custom field.

As you need the URL and not the ID of the image, you can follow these steps:

1. Please go to your "Coach_Profile_Picture" field's settings and set it to return "Image URL" and not "Image Array".
( screenshot: hidden link )

2. Next, in your view "learning course", you can replace the Toolset's shortcode with the one from the ACF:

Changing:


<img src='[wpv-post-field name="coach_profile" alt="Profile Image" width="100" height="100"  resize="crop" url="true"]' align="center"/>

To:


<img src='[acf field="coach_profile" post_id="[wpv-post-id]"]' align="center"/>

You can read more details on the topic from the ACF plugin's official documentation:
hidden link
hidden link

Note: to get more most accurate and up-to-date information related to features of a third-party plugin like ACF, we'll recommend consulting its official documentation and support.

I hope this helps.

regards,
Waqar

#1240338

My issue is resolved now. Thank you!