Codex

Function Reference/cat is ancestor of

Contents

Description

This is a simple function for evaluating if the second category is a child of another category.

Usage

 <?php cat_is_ancestor_of(cat1cat2); ?> 

Returns true if cat1 is an ancestor of cat2. Any level of ancestry will return true.

Arguments should be either integer category IDs or category objects.

Notes

If arguments are string representations of integers and not true integers cat_is_ancestor_of will return false.

Further Reading