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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.