Tag Display
-
Hi,
I am working on tag based image .. I have 4 tags in tag list and each tag has an image… suppose i have tag1 in my test post i want conditional based tag image… i want that if i have tagid=1 in my test post it will display the corresponding image.. i am using the below funtion but it display all the tag images but i need only conditon based tag
function my_trending_tags() {
$categories = get_categories(array( ‘taxonomy’ => ‘post_tag’, ‘orderby’ => ‘count’, ‘number’ => ’10’ ));
foreach ($categories as $category) {
$tax_term_id = $category->term_taxonomy_id;
$images = get_option(‘taxonomy_image_plugin’);
if($tax_term_id==2){
echo wp_get_attachment_image( $images[$tax_term_id], ‘full’ );
}
elseif($tax_term_id==3){
echo wp_get_attachment_image( $images[$tax_term_id], ‘full’ );}
else{
echo ‘test’;
}}
}
The topic ‘Tag Display’ is closed to new replies.