taxonomy images in wordpress

Posted: January 8, 2015 in All Category

$taxonomy_image_url = get_option('z_taxonomy_image'.$tax_term->term_id);
$attachment_id = developer_attachment_id_by_url($taxonomy_image_url); // Search in my post get attachment id by image url....

if(!empty($attachment_id)) {

$size = 'small-thumb'; $taxonomy_image_url = wp_get_attachment_image_src($attachment_id, $size); $taxonomy_image_url = $taxonomy_image_url[0];

}

<img src="<?php echo $taxonomy_image_url; ?>"/>

Advertisements
Comments
  1. Kunal says:

    thanks for this Sir…it is very useful for me……………