I am converting a Bootstrap template into a WordPress theme.
For custom fields I am using the plugin Advanced Custom Fields. The issue is when I am trying to add an image with the help of Advanced Custom Fields, I get the following error:
Warning: Illegal string offset 'url' in C:\wamp64\www\my-site\wordpress\wp-content\themes\bootstraptowordpress\page-home.php on line 31
However when I am adding text through this plugin it shows no error.
I have no other plugins installed other than ACF.
Here is my code:
$home_page_logo = get_field('home_page_logo'); <div class="front_logo"> <?php if( !empty($home_page_logo)): ?> <img src="<?php echo $home_page_logo['url']; ?>" alt="<?php echo $home_page_logo['alt']; ?>" /> <?php endif; ?> </div>