Put default image in ACF

I want to put a default image in custom taxonomy category using Advanced Custom Field Pro plugin.
I am using following code to show the featured image, I want to show a default image if there is no featured image.

<?php   
   if($category_image_url) { ?>
      <img src="<?php echo esc_url( get_template_directory_uri() ); ?>/timthumb.php?src=<?php echo $category_image['url']; ?>&w=250&h=200&zc=2"
           alt="<?php echo $term->name; ?>" 
           class="product_img">
<?php }else { ?>
      <img src="http://www.staticwhich.co.uk/static/images/products/no-image/no-image-available.png" 
           alt="<?php echo $category_image['name']; ?>" 
           title="<?php echo $category_image['name']; ?>">
<?php } ?>

Related posts

Leave a Reply