WordPress.org

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Is Page or Ancestor

Recursively test if the page you pass into this function is the current page or ancestor of that page.

This plugin is easy to use and very basic in its concept. It will recursively test if the page you pass into this function is the current page or ancestor of that page. You can pass either a page ID or page name and it will return true or false. For example, if I wanted to test that the current page I'm viewing is the About page or one of its ancestors, I would then use the following code to echo current_page_item if the function returns true.

<?php if (is_page_or_ancestor('about')) { echo 'current_page_item'; } ?>

Requires: 2.5 or higher
Compatible up to: 3.0.5
Last Updated: 2010-6-9
Downloads: 982

Ratings

3 stars
3.9 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1 100,1,1
100,3,3
100,2,2
100,1,1
100,1,1
0,1,0