Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$chosen_id = 1; // カテゴリID | |
$thisCat = get_category($chosen_id); | |
echo $thisCat->count; | |
?> |
Note
Description | 指定したカテゴリに属する記事の数をテーマファイル内で取得する |
---|---|
WordPress Ver. | 3.3.1 |
Via | Number of posts in a category |