WordPress: is_child function

Every once in a while I would like to test whether the current page is a descendant of another page. This is particularly useful if you want to display certain content on a subset of your pages only. Although the Codex suggests a similar is_tree function I would like to present an extended version here.

I’ve packaged the functionality inside a WordPress plugin called is_child that you can download here. Unzip it, upload it to wp-content/plugins and activate the plugin.

Continue reading →