I am using the Vote Me Up plugin http://wordpress.org/extend/plugins/vote-it-up/ on my site. I have the MostVotedAllTime function showing the top 10 posts. Currently this displays the Post Title only. I am wondering if it is possible to display a custom taxonomy associated with the post here.
for example it is a chart showing music albums where the post title is the album title. I have a taxonomy called artist which i would also like to display in the chart.
Does anybody know if this is possible or if there are any better plugins for this?
Here is the code for the MostVotedAlltime() function
1234567891011121314151617181920212223242526272829303132333435 function MostVotedAllTime_Widget() {$a = SortVotes();//Before?><div class="votewidget"><div class="title">Most Voted</div><?php$rows = 0;//Now does not include deleted posts$i = 0;while ($rows < get_option('voteiu_widgetcount')) {if ($a[0][$i][0] != '') {$postdat = get_post($a[0][$i][0]);if (!empty($postdat)) {$rows++;if (round($rows / 2) == ($rows / 2)) {echo '<div class="fore">';} else {echo '<div class="back">';}echo '<div class="votecount">'.$a[1][$i][0].' '.Pluralize($a[1][$i][0], 'votes', 'vote').' </div><div><a href="'.$postdat->guid.'" title="'.$postdat->post_title.'">'.$postdat->post_title.'</a></div>';echo '</div>';}}if ($i < count($a[0])) {$i++;} else {break; //exit the loop}}//End?>
Answer
Use get_the_term_list() to print the assigned terms.
Example:
|
1 2 3 |
echo '<div class="votecount">' . /* stripped */ . '</div>';
echo echo get_the_term_list( $post->ID, 'taxonomyname', 'Taxonomy Label: ', ', ', '' );
echo '</div>'; |
Replace ‘taxonomyname’ and ‘Taxonomy Label: ‘ with the values you actually need.


