As of April 2026, CSS Page Ancestors is a WordPress css plugin with 0 active installations and a 0/5 rating0. It has been downloaded 1.1K+ times in total. Requires WordPress 3.3+ and PHP 5.6+. Available on WordPress.org since 2017. Last updated 8 years ago — may have compatibility concerns. Top alternative: WPCode – Insert Headers and Footers +….
Please, keep in mind that THIS IS IN BETA. I’m relying to your feedback, positive or with suggestions, to release it out of beta
This plugin will give you the extra class you need in your tag of ALL (and not just one) of the anchestors of a page in WordPress.
This way you will be able to color a certain section of a site, based on the root’s ancestor – no matter how deep is the page (WordPress does this only for the direct father of a page)
Also, the printed class names are ancestor-[slug] and ancestor-id-[id]. This way, you can use it with your page slug (very conviniate if you move sites between instalations where id can change) and id (useful if you use a non-latin site, and slug can’t be used in css)
–
So, let’s imagine you have this tree of pages…
| WordPress | 3.3+ requiredTested up to 4.8.28 |
| PHP | 5.6+ required |
Removed the manual installation of the plugin, and converted it to a filter, so the users won’t touch their theme. (Thanks WordPress Plugin Directory Team for the tip!)
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.