Created
October 26, 2014 16:29
-
-
Save saltun/d2c52efb95f8d94093c2 to your computer and use it in GitHub Desktop.
WordPress Category and Post Count
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 | |
$args=array( | |
'include' => 1, // kategori id si gelecek - Category id | |
'orderby' => 'name', | |
'order' => 'ASC' | |
); | |
$categories=get_categories($args); | |
foreach($categories as $category) { | |
echo $category->name." (".$category->count.")"; // Genel (1) | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment