Featured image from URL with Jetpack Related Posts
-
In case somebody needs to use FIFU images with Jetpack Related Posts ?? Put this code in your themes functions.php or functionalizer plugin.
/* Jetpack Related Posts with Featured Image from URL thumbnails */ function jeherve_custom_image( $media, $post_id, $args ) { $permalink = get_permalink( $post_id ); $url = get_post_meta($post_id, 'fifu_image_url', true); return array( array( 'type' => 'image', 'from' => 'custom_fallback', 'src' => esc_url( $url ), 'href' => $permalink, ) ); } add_filter( 'jetpack_images_get_images', 'jeherve_custom_image', 10, 3 );
- The topic ‘Featured image from URL with Jetpack Related Posts’ is closed to new replies.