Last active
December 7, 2016 12:24
-
-
Save seredniy/fba4f1a0b75b670f9aa3b0cc72b2c338 to your computer and use it in GitHub Desktop.
Количество постов в категории WordPress
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
// Кол-во постов в категории | |
function scf_get_category_count($taxonomy, $name) { | |
// Формируем запрос | |
$term_slug = $name; | |
$term = get_term_by('slug', $term_slug, $taxonomy); | |
// возвращаем данные | |
return $term->count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment