• Resolved anvy

    (@anvy)


    Hello,

    I’m trying to add categories images in below code .. how to get the thumbnail using below code.

    <?php
    $counter = 0;
    $max = 6;
    $taxonomy = array('directors', 'producers', 'cinematographers', 'singers', 'writers', 'music_directors');
    $terms = get_terms($taxonomy);
    shuffle ($terms);
    //echo 'shuffled';
    if ($terms) {
    	foreach($terms as $term) {
    		$counter++;
    		if ($counter <= $max) {
    	  	echo '<p><a href="' . get_category_link( $term->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a></p> ';
    	 	}
    	}
    }
    ?>

    Please solve my problem. And also your website is not working ..

    thanks 🙂 it’s a good plugin 🙂

    http://wordpress.org/extend/plugins/categories-images/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Muhammad

    (@elzahlan)

    Thanks,
    1st so sorry, yes my website was down, put now it works great.
    you can now check the full documentation and you will find more than one example, you can use any of them to get the category thumb.

    or simply you can use this line of code 🙂
    <img src="<?php echo z_taxonomy_image_url($term->term_id); ?>" />

    Thread Starter anvy

    (@anvy)

    Hello,

    thanks for the help. But can you please post the full code integrating yours in the loop above ?

    For me, it’s not working .. 🙁

    thanks in advance.

    Thread Starter anvy

    (@anvy)

    When i’ve tried it’s giving me below url as image url :

    <?php%20echo%20z_taxonomy_image_url($term->term_id);%20?>

    can you please help me out.

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to use categories images in below loop …’ is closed to new replies.