• It’s simple and less intrusive than other plugins that do the same. It blends better with WordPress UI.

    It doesn’t show anything in the frontend if the correct code isn’t added to the theme, something like this I guess:

    <?php 
    $taximg_id = get_queried_object()->term_id;
    // image id is stored as term meta
    $image_id = get_term_meta( $taximg_id, 'image', true );
    
    // image data stored in array, second argument is which image size to retrieve
    $image_data = wp_get_attachment_image_src( $image_id, 'full' );
    
    // image url is the first item in the array (aka 0)
    $image = $image_data[0];
    
    if( $image ) {
    	echo "<img src=" . $image . " class='term-image'>";
    }
    
    ?>
  • The topic ‘Simple and less intrusive’ is closed to new replies.