Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rahul964

    (@rahul964)

    At the moment, I’m using this function to display a default image where thumbnails are missing. But I need a proper solution. I want to display the correct thumbnail for each post.

    function jeherve_custom_image( $media, $post_id, $args ) {
        if ( $media ) {
            return $media;
        } else {
            $permalink = get_permalink( $post_id );
            $url = apply_filters( 'jetpack_photon_url', 'https://firmwarefile.com/wp-content/uploads/firmware.png' );
          
            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 );

    Hi @rahul964

    I checked your site and the thumbnails are showing on my end.

    Could you send a screenshot with the error you are seeing, please?

    I recommend https://snipboard.io/ for easily sharing screenshots – please follow the instructions on the page, then paste the URL in this email. It works with Chrome and Firefox.

    Let me know if you have any questions.

    My best regards,

    Michelle

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Thumb Images not appearing’ is closed to new replies.