php - Custom taxonomy thumnbails for custom post type on category page -


i need display custom taxonomy thumnbail , name on category page. have code :

<h1><?php single_cat_title(); ?></h1>     <?php      $taxonomy = 'kategorie_goralskie';     $terms = get_terms($taxonomy, array('parent' => 0, 'orderby' =>      'meta_value', 'order' => 'desc') ); // top level terms of      taxonomy      if ( $terms && !is_wp_error( $terms ) ) :    ?>     <?php if ( have_posts() ) : ?>    <?php while ( have_posts() ) : the_post(); ?>     <div class="col-md-3">          <a href="<?php the_permalink(); ?>"><?php the_title();?></a>     </div>    <?php endwhile; ?>     <?php endif; ?> 

it shows name of child (its ok) must show thumnail too. how can ? tried in many ways enter image description here

in front-page.php ok, see taxonomy parent - : enter image description here

you need call the_post_thumbnail function somewhere in loop display thumbnail. can pass size of thumbnail whant in function parameter.

see detail of function here : https://developer.wordpress.org/reference/functions/the_post_thumbnail/


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -