$thumbnail = get_the_post_thumbnail( $the_id, $image_size ); if ( $thumbnail == '' ) { $press_pdf = get_field( 'press_releases_pdf', $the_id ); if ( $press_pdf ) { $file_url = $press_pdf['url']; $pdf_image = str_replace('.pdf', '-pdf.jpg', $file_url); } $thumbnail = '<img class="pdf-image-thumbnail" src="'.$pdf_image.'">'; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter