Question

I have a dynamic PHP website/blog that works fine to retrieve relevant information from my database: http://example.com/article.php?id='row id'

`<?php 
$id = $_GET['id'];
$results = $connect->query("SELECT * FROM main WHERE id = $id");
?>

<?php
while($row=$results->fetch())
{
?>

<!DOCTYPE html>
<html>
<head>
<title><?php echo ($row['headline']) ?></title>`

The above code works fine but when I try to populate facebook meta tags dynamically it does not work:

`<meta property="og:title" content="<?php echo ($row['headline']) ?>" />`

Any idea why the echo of data works fine for the <title> etc but does not echo for the meta tags?

FB Open Graph Object Debugger says: "The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags."

No correct solution

OTHER TIPS

can you post your rendered html code of facebook meta tags? I think the problem wasn't at fb meta tags, check your while loop and be sure that the echo of fb tags was inside the loop

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top