• Resolved hpb1980

    (@hpb1980)


    Hi,

    I’ve created a pod called Webinars and then a custom field called “webinar_speaker_1_image” which is a File/Image/Video field type. While trying to display it in the frontend, I tried embedding the magic tag “{@webinar_speaker_1_image}” in the src field of an img tag. However, this didn’t work. When I try using a shortcode with this field I get the URL of the image but it does not display the image. How do I show the image instead of the URL?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @hpb1980

    Where are you using this magic tag? Keep in mind that magic tags only work in Pods templates, not in your PHP/theme templates.

    If you are only outputting the URL then you need to wrap it within an image HTML tag.

    Please share your code so I can take a look. Also let me know where you put the code!

    Cheers, Jory

    Thread Starter hpb1980

    (@hpb1980)

    Hi,

    This is the page where the image is supposed to appear (below the download the ebook box on the right side): https://dev.excellarate.com/webinars/technology-roadmaps-accelerated-with-remote-teams/

    This was built using WP-Bakery’s page builder. They have the ability to add raw HTML blocks. One of those contains the following code. This, however, does not show me anything.

    <img src="{@webinar_speaker_1_image}" />

    I tried adding this shortcode [pods field="webinar_speaker_1_image"] as the src attribute but this just breaks the img tag on publishing. I also tried adding the same shortcode in a text box and that returned only the image URL.

    • This reply was modified 3 years, 11 months ago by hpb1980.
    • This reply was modified 3 years, 11 months ago by hpb1980.
    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @hpb1980

    Could you try [pods field="webinar_speaker_1_image._img"]?
    For a specific size please do: [pods field="webinar_speaker_1_image._img.medium"] (for medium size).
    Do not wrap this within an <img> tag or anything!

    Cheers, Jory

    Thread Starter hpb1980

    (@hpb1980)

    This worked. Thanks ??

    Plugin Author Jory Hogeveen

    (@keraweb)

    You’re welcome! The best way to say thanks is to leave a 5 star review at https://www.ads-software.com/plugins/pods/ and (if you’re feeling especially generous) become a Friend of Pods at https://friends.pods.io/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Actual image instead of the URL’ is closed to new replies.