Function not working in ‘single’ page for custom post type
-
Hi I am having a problem getting the function to work.
I have a custom post type called ‘bodhitalk’ and that post type has a custom taxonomy called ‘teacher’.
I am trying to call this function in a custom “single” page (in my case single-bodhitalk.php.)
So in I put this after ‘<?php while ( have_posts() ) : the_post(); ?>’:<?php
if (function_exists(‘get_wp_term_image’)) {
$meta_image = get_wp_term_image(teacher);
}
?>Then later in my code I call <?php echo $meta_image; ?>
I tried get_wp_term_image(teacher) and get_wp_term_image(‘teacher’) and get_wp_term_image($teacher), nothing is working.
Can you help?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Function not working in ‘single’ page for custom post type’ is closed to new replies.