Support

Account

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.