More debug messages for checking county id
authorLaury GvR <laury@gaslightmedia.com>
Wed, 6 Feb 2019 00:52:17 +0000 (19:52 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 6 Feb 2019 00:52:17 +0000 (19:52 -0500)
sections/interior-page.php

index bf4997f..0d9c339 100644 (file)
                 if ( get_field( 'member_county_id' ) ) {
                     $debugMsg[] = "using count page id";
                     $memberCountyId = get_field( 'member_county_id' );
-                } else if ( get_field( 'member_county_id', wp_get_post_parent_id() ) ) {
+                } else if ( get_field( 'member_county_id', wp_get_post_parent_id( $post ) ) ) {
                     $debugMsg[] = "using county page id of parent";
-                    $memberCountyId = get_field( 'member_county_id', wp_get_post_parent_id() );
+                    $memberCountyId = get_field( 'member_county_id', wp_get_post_parent_id( $post ) );
+                } else {
+                    $debugMsg[] = "no county page id?";
                 }
             }
         ?>
         // - county sub page:       member db map for that county from custom field
         // - any other page:        crowdriff script from custom field if exists,
         // ---  otherwise featured image if exists
-
+        $debugMsg[] = "Is county child:" . $isCountyChildPage . " memberCountyID: " . $countyPageId;
     ?>
     
+    
     <?php if ( $isCountyLandingPage ) { ?>
         <div id="header-crowdriff">
             <?php echo the_field('interior_header_crowdriff_script',$post->ID); ?>