You can do that by using this nice little function:
function is_page_or_child_of($slug){
global $post;
if (empty($slug))
return false;
//is it the page?
if ($post->post_name = $slug)
return true;
//check the children
$page = get_page_by_path($slug);
$children = get_pages('child_of=".$page->ID."&sort_column=post_date&sort_order=desc');
foreach ($children as $sub){
if ($post->ID == $sub->ID){
return true;
}
}
return false;
}
and instead of using is_page('our-school-district')
use s_page_or_child_of('our-school-district')
Related Posts:
- Control Content On Non-Blog Pages
- Insert menu with a custom walker into page / post body using shortcode?
- How to add page content into another page
- How to disable page delete
- get_pages() not ordering as it should
- How to move wp-content (or uploads) outside of the WordPress directory
- Editing Complex Pages in Visual Mode
- Multiple content areas per page
- Editing the Number at the end of Page URLs / Editing Page Slugs
- Pagination Help on Crazy Custom Authors Page
- Custom CSS for full post vs. excerpt (Content Options)
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- Hide page title in WordPress 3.0
- Selecting An image from the Media LIbrary on the frontend
- Custom protected password page with ACF
- Page load requires a trailing “/” [closed]
- Customize in category page
- Virtual Pages plugins
- Programmatically add a custom page/path/url/route to WordPress
- Static files or dynamic WP pages for “static content”?
- What is the most idiomatic way to let clients edit phrases in HTML?
- How to merge all my pages into one, while keeping a menu bar?
- How to change URL Custom Page?
- redirect product-category to a custom page
- custom headers for static home page and posts page
- Show posts on a page based on a category and tag(s)
- Split Conference WordPress Page in different years
- Add google org chart to wordpress page
- Javascript Solution Remove Specific Tag but leave the rest in a specific DIV
- How to get custom page template being edited in gutenberg editor
- custom meta box for page default template
- Best practice – pages – ACF or inline coding
- How to hook up search results page to a back-end page?
- How to structure model showcase
- How to customize
- Add a searchbox to the body of a page
- Create page as a file in my theme?
- Featured Image If Else Condition
- How to create “custom page types” with different custom fields in them?
- How to create custom search page
- Where to store reusable content that is not a page
- Creating php pages in wordpress and assigning them to wordpress pages
- How to display page ids as page slug names?
- How to create custom layouts and static pages in themes for clients
- How to make the Pages in WordPress Customized?
- Creating custom page template
- Change Site Logo or Menu Logo Per Page
- change top banner content on specific page
- Woocommerce custom archive page custom content and shortcode
- Use a custom page with dynamic content as a user profile page
- I want to embed mystream video in my wordpress site
- Swap home page based on user role, Elementor layout breaking
- Taxonomy template is not reading
- New Page/Post Screen Opens an Existing Post
- Static Page, need Last and Next links at the bottom
- How can I create a Custom Page? (not a page template!!)
- Problems with setting up a subdomain to serve images and scripts
- wordpress custom posts page not showing
- How to serve an already coded html page in a WP page, to assign a simpler url
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Admin menu disable new/delete page
- Show different pages on site depending on user choice
- WordPress post submit page
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Allow arbitrary text after page URL
- Show WP content on different PHP Sites
- Best way to create a page outside of the pages list
- Want home page to click through to two different page types
- Custom single page based on which custom page template is selected
- How to duplicate “Pages” section in the control panel?
- Page template with custom html fields inside a content
- Pass query param to custom page
- Is there a way to have information on one page automatically feed into another? [closed]
- how to add a page
- How to apply styles to the custom page template
- How can I make a search term redirect to a page
- Custom CSS working on home page but not on NEW created PAGE
- Create a page for each database table entries
- How to get input_attrs in the sanitize function?
- Change from /wp-admin/ to something else?
- Allow comments without approval for custom content type
- Add ‘Right Now’ widget to custom dashboard
- Naming script handles right way
- How to edit pages after installing WP
- Exclude custom taxonomy tag from loop
- Multiple WordPress outside wordPress installation?
- How to use
- How to check if a custom user profile field is empty
- How do I find PHP file that contains content of my page?
- List top 5 authors with most posts
- Create page template with some static contents
- Get users based on month ACF datepicker field
- Trigger Customizer Publish (save) Action
- External Link Button Under Post Excerpt on Index.php
- How to Remove the Custom Theme Panel from a Theme?
- After creating a new page, filling the page with structure
- Changing permalink of WordPress
- How to customize WordPress vertical menu?
- How to move menu next to left of the search box?
- how to manage Session in WordPress using custom login?