WordPress.org

Ready to get started?Download WordPress

Forums

Taxonomy Images
Get only de active term (2 posts)

  1. krnauta
    Member
    Posted 1 year ago #

    Hi all,

    I try to get only de current term by post.

    I use this function:

    <?php query_posts('orderby=name&order=asc&cat=5&showposts=100'); ?>
    						<?php while (have_posts()) : the_post(); ?>
    <?php
    $categories =  get_categories(array( 'taxonomy' => 'atributos' ));
     foreach ($categories as $category) {
     	$tax_term_id = $category->term_taxonomy_id;
     	$images = get_option('taxonomy_image_plugin');
     	echo wp_get_attachment_image( $images[$tax_term_id], 'thumbnail' );
     }
    ?>

    But is print all terms with image, not only select by post.

    Thks!

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

  2. krnauta
    Member
    Posted 1 year ago #

    Hi,

    I find the solution

    <?php
    print apply_filters( 'taxonomy-images-list-the-terms', '', array(
    	'after'        => '</ul>',
    	'after_image'  => '</li>',
    	'before'       => '<ul class="taxonomy-images-the-terms">',
    	'before_image' => '<li>',
    	'image_size'   => 'thumbnail',
    	'post_id'      => 0,
    	'taxonomy'     => 'category',
    ) );
    ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags