Create is_page_or_child() Template Tag
|Reported by:||FireMotion||Owned by:||anonymous|
Recursively determine if a page or one of its child pages is currently displayed.
Returns true when Page 42 or one of its child pages is being displayed.
It would also help to include the "exclude" parameter.
To create code for dynamic/collapsable menu's more easily.
Part of the variable currently equals:
strpos(wp_list_pages('echo=0&exclude='.$exclude.'&child_of='.$page_id), 'current_page_item') !== FALSE
But this only includes the child pages, not the page with $page_id itself.
Change History (7)
comment:2 FireMotion — 8 years ago
- Keywords tag menu page added
- Priority changed from normal to low
- Resolution invalid deleted
- Severity changed from normal to enhancement
- Status changed from closed to reopened
- Summary changed from Create is_current() Template Tag to Create is_page_or_child() Template Tag