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';