related taxonomy thumbnail for custom post type
-
Hi all,
I am trying to build a design portfolio theme, I set up a custom post type named ‘portfolio’ and a custom taxonomy (for instance I will have wed design, product design etc.). I got a way to display a list of related taxonomy but I am not able to add the thumnail to related content to be displayed at the end of single custom post page.that’s the code I actually have (inside single-portfolio.php), does anyone know hot to display thumbnails too?
<?php $sectors = get_the_terms( get_the_ID(), 'skills' ); if ( ! is_wp_error( $sectors ) ) { $term = array_shift( $sectors ); /* Query */ $jobs = null; if ( isset( $term->slug ) && isset( $term->taxonomy ) ) { $jobs = get_posts( array( 'term' => $term->slug, 'taxonomy' => $term->taxonomy, 'post_type' => 'portfolio', 'post_status' => 'publish', 'exclude' => get_the_ID(), /* exclude current project */ ) ); } /* Loop */ if ( $jobs ) { $_post = $post; print '<div id="related">' . "\n". ''; foreach ( (array) $jobs as $post ) { setup_postdata( $post ); the_title( ' <div class="related"><a href="' . esc_url( get_permalink() ) . '">', '</a></div>' . "\n". '' ); } print '</div>'; $post = $_post; } } ?>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘related taxonomy thumbnail for custom post type’ is closed to new replies.