jeudi 21 janvier 2016

Illegal string offset error in Wordpress with Advanced Custom Fields

I am using advanced custom fields plugin with Wordpress trying to echo out a simple image using the code provided in their instructions.

Its throwing me 2 errors for this code,

  • illegal string offset 'url'.
  • illegal string offset 'alt'.

Has anyone encountered this before?

    <?php $image = get_field('top-section-img'); ?>
    </php if(!empty($image)) : ?>
        <img class="service-top-right-image animation-duration" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
    <?php endif; ?> 



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire