2011-10-25 5 views

答えて

1
<?php $cats = get_categories('orderby=count&order=DESC'); 

foreach ($cats as $cat) : 

    $args = array(
    'posts_per_page' => 1, // max number of post per category 
    'cat' => $cat->term_id 
); 
    query_posts($args); 
    if (have_posts()) : while (have_posts()) : the_post(); ?> 
    <!-- show the ususal stuff in the loop --> 
    <?php endwhile; endif; wp_reset_query(); ?> 

<?php endforeach; ?> 
関連する問題