From f5198270f2d974353e8d2ef71aa3e92880178ec8 Mon Sep 17 00:00:00 2001 From: Dan Head Date: Sat, 2 Feb 2019 23:30:14 +0000 Subject: [PATCH] Replace open graph tags with Jetpack implementation --- theme/functions.php | 19 +++++++++++++++++++ theme/header.php | 8 -------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/theme/functions.php b/theme/functions.php index 674eba3..d84f953 100644 --- a/theme/functions.php +++ b/theme/functions.php @@ -150,3 +150,22 @@ function windycoys_is_ie() { } return false; } + +function windycoys_jetpack_custom_image($media, $post_id, $args) { + if ($media) { + return $media; + } else { + $url = get_template_directory_uri() . '/images/icon.png'; + $permalink = get_permalink($post_id); + + return array( + array( + 'type' => 'image', + 'from' => 'custom_fallback', + 'src' => esc_url($url), + 'href' => $permalink, + ) + ); + } +} +add_filter('jetpack_images_get_images', 'windycoys_jetpack_custom_image', 10, 3); diff --git a/theme/header.php b/theme/header.php index e04a519..3e33519 100644 --- a/theme/header.php +++ b/theme/header.php @@ -13,14 +13,6 @@ $manifest = get_template_directory_uri() . '/manifest.json'; <?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' « '; } ?> <?php bloginfo('name'); ?> - - "/> - - "/> - - - -