Skip to content

Instantly share code, notes, and snippets.

@mfields
Created June 15, 2011 02:29
Show Gist options
  • Select an option

  • Save mfields/1026364 to your computer and use it in GitHub Desktop.

Select an option

Save mfields/1026364 to your computer and use it in GitHub Desktop.
Taxonomy Images Plugin Custom "get_the_terms" Loop
<?php
/*
* Use Taxonomy Images filter to get all speakers
* associated with the current post.
*/
$speakers = apply_filters( 'taxonomy-images-get-the-terms', '', array(
'taxonomy' => 'category',
) );
/*
* Loop over output.
*/
foreach( (array) $speakers as $speaker ) {
print '<div class="speaker">';
/* Print taxonomy image. */
print wp_get_attachment_image( $speaker->image_id, 'thumbnail' );
// Do stuff from the other plugin here.
// The $speaker var should hold all you need to get the meta.
print '<pre>' . print_r( $speaker, true ) . '</pre>';
print '</div>';
}
@mfields
Copy link
Author

mfields commented Jun 15, 2011

You might want to change the "taxonomy" argument to something other than "category" ... I might want to earn to proof-read things before I publish them :)

@anointed
Copy link

i got it, 6 months ago would have asked why it didn't work.. now i am finally starting to understand what I am reading at least

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment