PowenKo > PHP > WordPress > Post > Display all posts on the category id

February 2, 2012   ·   0 Comments

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."'>";
					for($i=0;$i<$i_space;$i++){
					 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>";
			 endforeach;
			echo "</ol>";
			
	}
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Wordpress99

Wordpress

Amazon

adsbygoogle

Recent Posts

Categories

Amazon