0

My facebook is grabbing the wrong image.

I try to adding this open graph image in my head.

<meta property="og:image" content="<?= $_GET['image'] ?>" />

and

<meta property="og:image" content="<?php echo $image; ?>"/>

but the content image path is not shown. It became this

<meta property="og:image" content="" />

I want it to be like this. If the article A have image a_name.jpg, the meta will be <meta property="og:image" content="/images/a_name.jpg"/>

If the article B have image b_name.jpg, the meta will be <meta property="og:image" content="/images/b_name.jpg"/>

0

1 Answer 1

0

You need to supply the tag the full URL to the image. If you install the Metatag module not only can you have full control over keyword, description, etc. but also all the og tags too per node.

5
  • I want the Metatag open graph image has a unique image path in every pages. Insert a URL will define showing the same image all articles.
    – user73963
    Jun 18, 2015 at 12:11
  • Yes that's exactly what I'm saying, and the Metatag module does it for you Jun 18, 2015 at 13:55
  • What is the code should I put?
    – user73963
    Jun 18, 2015 at 13:58
  • No code, install the module and when editing the node in the vertical tabs at the bottom one is called Meta tags and you can override the default settings Jun 18, 2015 at 14:05
  • I get you. It needs to add in every node.
    – user73963
    Jun 19, 2015 at 2:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.