is_child_of_category(0);// When a top level category is being displayed, zero being the parent id value for top level categories (e.g. categories with no parents).
//当显示顶级类别时,零是顶级类别(例如,没有父母的类别)的父ID值。
is_child_of_category(12);
is_child_of_category(12);
// When the current category is a direct child of the category whose ID is '12'.
//当前类别是ID为'12'的类别的直接子代时。
is_child_of_category('tv-shows')
is_child_of_category('电视节目')
// When the current category is a direct child of the category with the slug 'tv-shows' (can also be category ID's).
//当当前类别是带有“ tv-shows”子句(也可以是类别ID)的类别的直接子代时。
is_child_of_category('tv-shows', 'dexter');
is_child_of_category('tv-shows','dexter');
// When the category with slug 'dexter' is a direct child of the category with the slug 'tv-shows' (can also be category ID's).
//如果带有“ sug”“ dexter”的类别是带有“ sv-shows”的类别的直接子代(也可以是类别ID)。
This may come in handy when manipulating categories while not in a category template.
当不在类别模板中操作类别时,这可能会派上用场。
is_child_of_category('tv-shows', 'dexter', false);
is_child_of_category('tv-shows','dexter',false);
// When the category with the slug 'dexter' is a descendant of the category 'tv-shows' at any level.
//当类别为“ dexter”的子类别是任何级别的“电视节目”类别的后代时。
(uses cat_is_ancestor_of())
(使用cat_is_ancestor_of())
is_child_of_category('tv-shows', null, false);
is_child_of_category('电视节目',null,false);
// When the current category is a descendant of the 'tv-shows' category at any level.
//当前类别是任何级别的“电视节目”类别的后代。
(uses cat_is_ancestor_of())
(使用cat_is_ancestor_of())
is_parent_of_category(13);
is_parent_of_category(13);
// When the current category is the direct parent of a category with the ID '13'.
//当前类别是ID为'13'的类别的直接父级时。
is_parent_of_category('dexter');
is_parent_of_category('dexter');
// When the current category is the direct parent of the category with the slug 'dexter'.
//当前类别为子类别“ dexter”的直接父类别时。