WordPress.org

Ready to get started?Download WordPress

Forums

Taxonomy Images
Image URL for a specific category (1 post)

  1. vmodha
    Member
    Posted 1 year ago #

    I'm trying to use the filter 'taxonomy-images-queried-term-image-url' to obtain the URL for a specific category, so not the current category. How can I do this?

    I've come up with a solution but I dont believe it's the most effecient one.

    This works (category 3 is temporarily hard coded):

    $categories = apply_filters( 'taxonomy-images-get-terms', '', array(
    'term_args' => '&include=3orderby=count&hide_empty=0'
    ) );
    $category_image = wp_get_attachment_image_src( $categories[0]->image_id, 'small' );
    
    echo '<img src="' . $category_image[0] . '" alt="" />';

    http://wordpress.org/extend/plugins/taxonomy-images/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.