Child pages of the counties page default to using the county-page template
authorLaury GvR <laury@gaslightmedia.com>
Fri, 15 Feb 2019 22:25:12 +0000 (17:25 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 15 Feb 2019 22:25:12 +0000 (17:25 -0500)
sections/interior-page.php

index b1d3133..cce743a 100644 (file)
@@ -3,6 +3,10 @@
     $countyPageId = -1;
     // Find template - remove file extension for easier checking. Assign container class based on template
     $template = str_replace( ".php", "", get_page_template_slug( $post->ID ) );
+    // All child pages of the counties page default to using the county-page template
+    if ( $template == "" && is_in_tree( COUNTIES_PAGE_ID ) ) {
+        $template = "county-page";
+    }
 ?>
 <main class="page-inside <?php echo ($template ?: 'default-template');?>">
     <?php if ( is_in_tree( COUNTIES_PAGE_ID ) ) { ?>