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.

This plugin has been closed and is no longer available for download.

Is Page or Ancestor

Description

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'; } ?>

Installation

To install, simply unzip the download provided and follow these steps:

  1. Place the is-page-or-ancestor folder into your /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

To uninstall the plugin, please perform the following steps.

  1. Deactivate the plugin through the ‘Plugins’ menu in WordPress
  2. If desired, remove the is-page-or-ancestor folder from your /wp-content/plugins/ directory

Contributors & Developers

“Is Page or Ancestor” is open source software. The following people have contributed to this plugin.

Translate “Is Page or Ancestor” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.1

  • Fixed Wrong datatype for second argument error

1.0.1

  • Modified how the plugin gets ancestors

1.0.0

  • Initial Release