Hey folks, I use:

<? require_once('tpl/head.tpl') ?>

in one of my sites, but I frequently need people to share certain articles on FB, but I'd also like the relevant image for each, respective article to appear as the FB thumbnail. Is there a way I can write

<link rel="image_src" href="http://www.website.org/thumbnail.jpg" />

into my header so it picks up the correct image for each article?

I tried to write

<? $image="/images/thumbnail.jpg" ?>

into each page, which should work on each page, but I don't know how to write the corresponding PHP in the header. I tried using

<link rel=<?=$image;?> </link>

but it's not working. I've tried other methods, but it just shoots back errors. Any suggestions would be awesome.

Thanks!

Responding to your own post is so lame, but I'm lost

Tried this too

<link rel="image_src" href="<?php echo $image; ?>" />

to no avail

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.