Show custom texonomy menu image on a archive post page

By | October 13th 2018 05:15:32 PM | viewed 195 times

how to show custom texonomy menu image on a page

create a custom taxonomy of a posttype with wck and custom field and add some data(additional field)

Now add a page as archive-posttype.php and add the following code


<?php get_header();

   global $wpdb;
   global $submenu;
   $results = $wpdb->get_results( 'SELECT distinct a.name,a.term_id FROM uk_terms a,uk_term_taxonomy b WHERE a.term_id=b.term_id and b.taxonomy="resturent_menu" and b.parent=0 order by a.name asc');

	
?>
                 <?php 
				 
				  $tid = ($_GET['tid'])? $_GET['tid']:null;

				    if(! empty($tid)){
					    $submenu = $wpdb->get_results( 'SELECT distinct a.name,a.term_id,b.description FROM uk_terms a,uk_term_taxonomy b WHERE a.term_id=b.term_id and b.taxonomy="resturent_menu" and b.parent="'.$tid.'"order by a.name asc');

					}

                 ?>
		
						       <div class="title-h2" align="center">
                                           
                                  Main  Menu 
                                           
                               </div>
						
					
		                           <?php

      
						    foreach($results as $resu){
							  
                                   ?>            
                                             <img src="term_id)['sizes']['medium']; ?>" class="attachment-thegem-portfolio-masonry" alt="Sea Food" >
                                              <div class="title title-h4"> name; ?> </div>          
	  
				                 <?php }  ?>  	  

<?php get_footer();?>


bONEandALL