• I just can’t get this to display the image url

    The documentation says that this will work, but I can’t get it to work.

    $image_url = apply_filters( 'taxonomy-images-queried-term-image-url', '' );

    It echoes nothing.

    I can get this to work

    echo wp_get_attachment_image( $term->image_id, 'related' );

    But that’s not quite what I’m after as I want the image to display with the <img> tag i.e.
    <img src="<?php echo $src; ?>

    https://www.ads-software.com/plugins/taxonomy-images/

Viewing 1 replies (of 1 total)
  • Thread Starter jelly_bean

    (@jelly_bean)

    I’ve got it working. But I’ve decided to use it as a background image instead of an img.

    <?php $src = wp_get_attachment_image_src( $term->image_id, 'related' ); ?>
    <div style="background:url('<?php echo $src[0]; ?>') no-repeat center center / cover; height: 428px;"></div>

    img would be:

    <img src="<?php echo $src; ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Image url’ is closed to new replies.