カテゴリー毎に投稿件数を表示したい!
-
下記のソースを調整して各カテゴリーごとの投稿件数を
“コンテンツ特集!”の後に表示をしたいのですがうまくいきません。<?php
if(get_theme_mod(‘home_onecol_cats’))
$categories = get_categories(‘parent=0&orderby=id&include=’.get_theme_mod(‘home_onecol_cats’));
else
$categories = get_categories(‘number=1&parent=0&orderby=id&include=’.get_theme_mod(‘home_onecol_cats’));
$catcount = 0;foreach ($categories as $cat) {
echo ‘<div id=”catbox1-‘.$catcount.'” class=”catbox’;
if(is_int($catcount/2)) echo ‘ catbox-even’; else echo ‘ catbox-odd’;
echo ‘”>’;if(get_theme_mod(‘home_onecol_feedlink’) == ‘Yes’) {
echo ‘<span class=”cat-feedlink”>cat_ID, ”).'” title=”‘;
printf(__(‘%sのRSS購読 ‘,’themejunkie’),$cat->cat_name);
echo ‘”>’;
printf(__(‘%sのRSS購読’,’themejunkie’),$cat->cat_name);
echo ‘</span>’;
}echo ‘<h3 class=”catbox-title”>cat_ID).'” title=”View all posts under ‘.$cat->cat_name.'”>’.$cat->cat_name.’コンテンツ特集!</h3>’;
echo ”;
query_posts(‘showposts=’.get_theme_mod(‘home_onecol_num’).’&cat=’.$cat->cat_ID);
$postcount = 0;
while (have_posts()) : the_post();
global $post;
include(TEMPLATEPATH. ‘/includes/onecol-loop.php’);
$postcount++;
endwhile;
wp_reset_query();echo ‘</div><!– end .catbox –>’;
$catcount++;
}
?>BlogStats PCC Pluginなどのプラグインもいれて
数度となく試しましたがやはり無理でした。アドバイス頂けたら助かります。
よろしくお願いします。
トピック「カテゴリー毎に投稿件数を表示したい!」には新たに返信することはできません。