Skip to content

Instantly share code, notes, and snippets.

@civita
Created October 8, 2019 19:07
Show Gist options
  • Save civita/963b4e297312c9fcebbacbf19a7b91b1 to your computer and use it in GitHub Desktop.
Save civita/963b4e297312c9fcebbacbf19a7b91b1 to your computer and use it in GitHub Desktop.
<meta property="og:title" content="<?php if (isset($template)) { p($template->getHeaderTitle()); } else { p($theme->getName());} ?>">
<meta property="og:site_name" content="<?php p($theme->getName()); ?>">
<meta property="og:description" content="<?php if (isset($template)) { p($template->getHeaderTitle()); echo " - "; p($template->getHeaderDetails()); } else { p($theme->getName());} ?>">
<meta property="og:image" content="
<?php
$og_image_dict = json_decode(file_get_contents("https://download/link/for/JSON/file"), true);
if(array_key_exists($_SERVER['REQUEST_URI'], $og_image_dict)) {
echo($og_image_dict[$_SERVER['REQUEST_URI']]);
} else {
// Default og:image
echo($og_image_dict['default']);
}
?>
">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment