WP: 4.5.3
ACF: 5.3.9.2
I’m experiencing Illegal string offset ‘url’ error.
<br /> <b>Warning</b>: Illegal string offset 'url' in <b>/home/....</b> on line <b>108</b><br />
Code:
<?php
$retheading = get_field('ret_heading',163);
$retcont = get_field('ret_content',163);
$leftcont = get_field('left_column_content',163);
$centercont = get_field('center_column_content',163);
$rightcont = get_field('right_column_content',163);
$botcont = get_field('bottom_content',163);
if( !empty($retcont) ): ?>
<section id="retinal">
<div class="container">
<h3><?php echo $retheading; ?></h3>
<?php echo $retcont; ?>
<div class="col-sm-4">
<?php echo $leftcont; ?>
</div>
<div class="col-sm-4">
<?php if( !empty($centercont) ): ?>
<img src="<?php echo $centercont['url']; ?>" />
<?php endif; ?>
</div>
<div class="col-sm-4">
<?php echo $rightcont; ?>
</div>
<?php echo $botcont; ?>
</div>
</section>
<?php endif; ?>
Line 108 is:
<?php if( !empty($centercont) ): ?>
<img src="<?php echo $centercont['url']; ?>" />
<?php endif; ?>
Field setting for “center_column_content” is:
LABEL: Center Column Content
NAME: center_column_content
TYPE: Image
RETURN VALUE: Image URL
All field names are unique from others
I’ve read several forum posts regarding ‘Illegal string offset ‘url’ and have tried the following:
Changing the variable(s)/field name(s)
Switching between Image ID and Image URL to post Image
Disabled/Enabled ACF
I’m not having any other issues with posting images with unique variables.
Other options to try?