Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

318
Views
opengraph dynamic images for Facebook, Telegram and Whatsapp

I have a travel site with a url like this one

http://www.mysite.tv/index.php?destination=somePlace

And when I share the url on Facebook, Telegram and Whatsapp I want to show an image for each destination.

For this in my index.php I have

<meta property="og:image" class="htmlImage" content="https://www.mysite.tv/img/img_<?php echo $_GET['destination'];?>.jpg" />

and in the img folder I have the appropriate image for each location.

The following happens:

To make it work on Facebook, I use the dynamic image but also a generic static image, although only the dynamic one is visible. This way:

<meta property="og:image" class="htmlImage" content="https://www.mysite.tv/img/img_<?php echo $_GET['destination'];?>.jpg" /> 
<meta property="og:image" class="htmlImage" content="https://www.mysite.tv/img/generic_image.jpg" />

also works for Telegram but this does not work for Whatsapp as it shows a cached static image.

And in Whatsapp only works a static image so I can not show an image for each of the destinations, only the generic static image.

<meta property="og:image" class="htmlImage" content="https://www.mysite.tv/img/generic_image.jpg" />

Is it possible to do some kind of programming to make it work on all three platforms?

If not possible, I mainly need it to work on Whatsapp, why doesn't a dynamic image work here, what can I do?

PS: please understand that it is not a problem of the image showing or not, I follow the design standards and static images always show without problems. It is a question of a dynamic image being displayed in the meta tags.

Thank you! !

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just in case somebody needs it, I have found the solution for me. Many many thanks to lcjr who posted it in the lazacode site.

Here it is:

<meta property="og:type" content="website"/>
<meta property="og:site_name" content="Edgeprop.my">
<meta property="og:url" content="<?php echo $ewfUrl; ?>" />
<meta itemprop="url" content="<?php echo $ewfUrl; ?>" />
<meta property="og:image" content="<?php echo $ewfImg; ?>" />
<meta itemprop="image" content="<?php echo $ewfImg; ?>" />
<meta name="image" content="<?php echo $ewfImg; ?>">
<meta name="twitter:image:src" content="<?php echo $ewfImg; ?>">
<meta property="og:title" content="<?php echo $ewfTitle; ?>" />
<meta name="twitter:title" content="<?php echo $ewfTitle; ?>">
<meta itemprop="name" content="<?php echo $ewfTitle; ?>">
<meta property="og:description" content="<?php echo $ewfDesc; ?>" />
<meta itemprop="description" content="<?php echo $ewfDesc; ?>">
<meta name="twitter:description" content="<?php echo $ewfDesc; ?>">
<meta name="description" content="<?php echo $ewfDesc; ?>">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:alt" content="<?php echo $ewfDesc ?>" />
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!