Display all posts on the category id

	function Display_Posts($t_id){
			$argsposts = array('numberposts' => 2000,'offset'=> 0,'category' =>$t_id, // $airport2->term_id,
                               'orderby'=> 'post_date','order'=> 'DESC','post_type' => 'post',
							   'post_status' => 'publish' );
			$postslist = get_posts( $argsposts );
			echo "<ol>";
			 foreach ($postslist as $post) :  setup_postdata($post); 
					echo "<li><a href='?p=".$post->ID."'>";
					 echo "  ";
			 $image_url = get_the_post_thumbnail_src(get_the_post_thumbnail( $post->ID));
			echo '<img src="'.$image_url.'" width="60" height="60" alt="'.$post->post_title.'">';			
					echo $post->post_title."</a></li>";
			echo "</ol>";

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is www.looptek.com

Leave a Reply