• Hi there,
    I would imagine that this a recurring question buty not to me…
    I have a repeater field set up that includes an image field.
    The field name is shoot_photo and is st to return = Image URL
    The code I have is:

    ........$image = get_sub_field('shoot_photo'); ?>
            <li class="slide">
            <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>">
           </li>

    Why doesn’t this work please (I’ve tried a dozen variations of this code with & without the “Slide”class with no luck)?

    I’m totally confused.
    Paul

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter ageingdj

    (@ageingdj)

    Anyone?

    I can’t seem to get any images to display on the front end via a ACF PHP template.
    I have no idea what I’m doing wrong.
    Thanks

    Hello @ageingdj,

    If you are using URL as return type then you can get image src using the $image and no need to use $image['url'].

    $image['url'] is used when return type is set to array.

    Thread Starter ageingdj

    (@ageingdj)

    Hi there & thanks for the reply but I’ve no idea what you are telling me!
    I want to see the photo on the front end, what do I use please?

    Hello. Check if your ACF Fields is with right display conditions. So if your ACF fields for a main page, check that it set to the main page. https://joxi.ru/Y2L4OJ0iQedy12

    Thread Starter ageingdj

    (@ageingdj)

    Thanks for the answer, but my settings are:
    Post Type/ Equal to/ Shoot Detail (which is defined via CPT UI)

    Hello @ageingdj,

    As you mentioned your image field return type is URL then in the code you can not use $image['url']. Your code should be like below:

    
    $image = get_sub_field('shoot_photo'); ?>
    <li class="slide">
        <img src="<?php echo $image; ?>">
    </li>
    
    Thread Starter ageingdj

    (@ageingdj)

    Hi Jaini,
    Thanks for taking the trouble but this doesn’t work either.
    It just adds blank “placeholder’s” (I don’t know the correct term).
    I think it mught be a plugin conflict.
    Many thanks
    Paul Miller

    Hello @ageingdj,

    Can you please share your field group screenshot here?

    Thread Starter ageingdj

    (@ageingdj)

    Hi there,
    Thanks for everything, I’ll try and do this on Monday (I’m a busy boy!)
    Thanks
    Paul

    Thread Starter ageingdj

    (@ageingdj)

    Hi Jainil,

    I have a screenshot but can’t figure out how to display it on these posts.
    If you let me have your email, I’ll send it to you.
    Paul

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Image not showing’ is closed to new replies.