WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Taxonomy Images] Template Page Custom Taxonomy return ALL

[Plugin: Taxonomy Images] Template Page Custom Taxonomy return ALL

  • I really enjoy the features that Taxonomy Images affords. After a lot of trying, I was finally able to get category images to appear on a page template with the following code:

    <?php global $taxonomy_images_plugin;
    			$cats = get_categories( 'order=desc&orderby=count&child_of=3&hide_empty=1&term_id=-708' );
    				foreach ( $cats as $c ) {
    					if ($c->count > 1){
    						$url = get_category_link( $c->term_id );
    								$img = $taxonomy_images_plugin->get_image_html( 'thumbnail', $c->term_taxonomy_id );
    							if( !empty( $img ) )
    							print '<a href="' . $url . '" title="' . '">' . $img . '</a>';
    						}
    				} ?>

    Now, I’m trying to get the same result with a custom taxonomy ‘services’. I’ve tried all the code snippits to accomplish this that I can find — but haven’t had any luck. I am able to get wp_list_categories to return a list of the custom taxonomy with this code:

    $args = array(
    		  'taxonomy'     => 'services',
    		  'depth'     	 => '1'
    		);global $taxonomy_images_plugin;
    			$cats = wp_list_categories( $args );
    				foreach ( $cats as $c ) {
    					if ($c->count > 1){
    						$url = get_category_link( $c->term_id );
    							$img = $taxonomy_images_plugin->get_image_html( 'thumbnail', $c->term_taxonomy_id );
    						if( !empty( $img ) )
    						print '<a href="' . $url . '" title="' . '">' . $img . '</a>';
    					}
    				}

    But it won’t show the images.

    Anyone have any code they’ve been successful in using to return a complete list of custom taxonomy images on a page template?

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

Viewing 1 replies (of 1 total)
  • The function wp_list_categories() wont return other taxonomies, use another function!
    Also get_category_link() is wrong!

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Taxonomy Images] Template Page Custom Taxonomy return ALL’ is closed to new replies.