$_img ) { if ( substr( $_img, 0, strlen( "{$img_name}" ) ) === "{$img_name}" ) { unset( $new_candidates[ $_key ] ); } } $GLOBALS['prevdem_img'] = $new_candidates; return get_template_directory_uri() . 'includes/preview-demo/images/' . $img_name; } /** * Filter thumbnail image * * @param string $input Post thumbnail. */ function andrina_the_post_thumbnail( $input ) { if ( empty( $input ) ) { $placeholder = andrina_get_prevdem_img_src(); return ''; } return $input; } add_filter( 'post_thumbnail_html', 'andrina_the_post_thumbnail' );