currently i am stuck with the problem .my code is
$category_ids = get_all_category_ids();
foreach($category_ids as $kk=> $cat_id) 开发者_JAVA技巧{
$cat_name= query_posts( 'posts_per_page=1&orderby=date&order=ASC&cat='.$cat_id);
if (have_posts ()) :while(have_posts()):the_post
this is the code i write in my loop.php file what i want is to take only latest post by category showing only 1 post of each category by date
You can download a plugin like this and find out how it is done. Also, this thread has something that may help you. It contains a snippet that shows the last post in each of a list of categories. Wold post the code, but it craps up the formatting, sorry.
精彩评论