Home › Forums › Backend Issues (wp-admin) › Image Alt Tag › Reply To: Image Alt Tag
thanks for the reply however
after trying this:
<?php
$image = get_field(‘client_2_image’);
if( !empty($image) ): ?>
” alt=”<?php echo $image[‘alt’]; ?>” title=”working”/>
<?php endif; ?>
I get the following error…
<img src="<br />
<b>Warning</b>: Illegal string offset 'url' in <b>C:\xampp\htdocs\wordpress-4.1.1\wordpress\wp-content\themes\byersenterprises\page.php</b> on line <b>161</b><br />
h" alt="<br />
<b>Warning</b>: Illegal string offset 'alt' in <b>C:\xampp\htdocs\wordpress-4.1.1\wordpress\wp-content\themes\byersenterprises\page.php</b> on line <b>161</b><br />
h" title="working">
it grabs the right image as I added this code to echo the info:
<?php echo $image, the_field(‘client_2_image’) ?>
and both are the same url, but no, alt and the url does not work.
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.