Home › Forums › General Issues › Image Object and Image URL not working. › Reply To: Image Object and Image URL not working.
Hi @sjl,
Thanks for the post.
For the Url return type, you can use the following code:
$home_banner = get_field('field_name', 123); // 123 is the post id that the field is listed in.
<script>window.home_banner = “<?php echo $home_banner; ?>”;</script>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”banner”>
<h1>Bringing nature to you <span>wherever you are</span></h1>
</div>
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.