Support

Account

Home Forums Backend Issues (wp-admin) Images URL & ID ! Reply To: Images URL & ID !

  • I might be misunderstanding but the image object should provide you with both the URL and the ID.

    Be sure to set the upload to “Image Object” in the ACF field editor. Then something like this should work:

    $img = get_field('image');
    <a href=<?php echo $img["url"] ?> rel="lightbox">
      <span class="ititle"><?php the_field('titre'); ?></span>
      <img src=<?php echo $img["sizes"]["large"]; ?> />
    </a>

    Replace [“large”] with which ever size you want. Do a print_r($img) to see what’s available.