How do i get the value of $image['link'] and insert it into the meta property <INSERT IMAGE LINK HERE> in the head tag?? i tried <meta property="og:image" content="<?php echo $image['link']; ?> />" /> but gave me error. thanks
Hi, Your code looks fine, Just make sure, your data on 'echo $image['link'];' should not have double Quote ' " ', use <meta property="og:image" content="<?php echo addslashes($image['link']); ?> /> and try it and let me know if any issues
Its not working. But when i put it inside the bodytag, the image link shows up, and when i put it in the head, its just empty. no error. All php codes are below the metatag
That's because the $image['link'] doesn't exist when you try to use it. If you need to include it in the meta-tag, you need to move the php code above the meta-tag you're including it in. That should be fairly obvious...
is this file a .php file or a .html? like PoPSiCLe said, you need PHP code above this to setup that array (load from mysql or whatever)