Cant get the get_wp_term_image function to work with term-id
-
Hey,
I have this problem.
Cant get the get_wp_term_image function to work with term-id in order to show the image. what can be the problem?also cant echo data from inside the condition
function_exists
condition
This is my code<li> <?php $term_list = wp_get_post_terms($post->ID, 'blog_theme', array("fields" => "all")); //print_r($term_list); if (function_exists('get_wp_term_image')) { $meta_image = get_wp_term_image($term_list[0]->term_id); //It will give category/term image url } echo '<div align="center" width="24px"><img class="cat-img" src="' . $meta_image . '" alt="' . $meta_image . '" ></div>';?> </li> <li><?php echo $term_list[0]->name; ?></li> </ul>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Cant get the get_wp_term_image function to work with term-id’ is closed to new replies.