Support » Plugin: Category and Taxonomy Image » Can’t display the image

  • Hi,

    I try to use your plugin with this code:

    <?php 
    if (function_exists('get_wp_term_image'))
    {
        $meta_image = get_wp_term_image($totorial);
        }
    echo $meta_image;
    ?>

    but nothing is shown.
    (my category id is “totorial”)

    Thanks in advance for your help!

    • This topic was modified 2 years, 8 months ago by  chenpro.
Viewing 3 replies - 1 through 3 (of 3 total)
  • I have the same problem

    This code will help:

    <?php 
    if (function_exists('get_wp_term_image'))
    {
    	$term_id = $GLOBALS['cat'];
        $meta_image = get_wp_term_image($term_id); 
        //It will give category/term image url 
    }
    
    echo '<div align="center"><img src="' . $meta_image . '" alt="" ></div>';
    ?>

    Hey thanks!
    I’v try it and it works brilliant!

    But what if I want to display two images based categories\taxonomies,
    one for ‘subject’ (animals, object, etc.)and other for ‘level’ (easy\hard)
    in two different locations, but for the same post?

    Thanks again:)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t display the image’ is closed to new replies.