functions.php
/* ===============================================
# timthumb
=============================================== */
define('THEME_DIR', get_template_directory_uri());
/* Timthumb CropCropimg */
function thumbCrop($img='', $w=false, $h=false , $zc=1, $a=false, $cc=false ){
if($h)
$h = "&h=$h";
else
$h = "";
if($w)
$w = "&w=$w";
else
$w = "";
if($a)
$a = "&a=$a";
else
$a = "";
if($cc)
$cc = "&cc=$cc";
else
$cc = "";
$img = str_replace(get_bloginfo('url'), '', $img);
$image_url = str_replace("http://","http://",THEME_DIR) . "/timthumb/timthumb.php?src=" . $img . $h . $w. "&zc=".$zc .$a .$cc;
return $image_url;
}
HTML
<?php
$image = get_field('image');
$size = 'large'; // (thumbnail, medium, large, full or custom size)
if ($image) {
$image_url1 = wp_get_attachment_image_url($image, $size);
$image_url2 = get_template_directory_uri() . "/timthumb/timthumb.php?src=" . $image_url1 . '&h=564' . '&w=752';
?>
<img src="<?php echo $image_url2; ?>">
<?php
} else {
?>
<img src="https://placehold.jp/eeeeee/ffffff/752x564.png?text=No%20photo" alt="">
<?php
}
?>