fixing featured image page inheritance
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 29 Jan 2016 20:40:20 +0000 (15:40 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 29 Jan 2016 20:40:20 +0000 (15:40 -0500)
css/app.css
functions.php
js/app.js
js/custom/pageSetup.js
scss/_wordpress.scss

index 64beb8a..4dc6595 100644 (file)
@@ -6205,16 +6205,6 @@ img.alignleft {
     #blog-side-info {
       text-align: center; } }
 
-@media print {
-  #addthis_wrapper, #copyright, #respond, #blog-side-info-wrapper, #footer_address, #action-items, #crumb-line, .no-featured, aside, header, nav, footer {
-    display: none; }
-  #blog-posts-over, #blog-posts-over p {
-    page-break-before: always; }
-  img {
-    page-break-before: always; }
-  h1, h2, h3, h4, h5, h6 {
-    page-break-before: always; } }
-
 h1, h2, h3, h4, h5, h6 {
   clear: both; }
 
index 524626a..0cfe167 100644 (file)
@@ -81,14 +81,12 @@ function glm_site_scripts()
 /* Header for posts*/
 function glm_get_header() {
     global $post;
-    
+    $post_id = $post->ID;
     echo '<div';
     // inherit featured image from parent pages
-    if ( $post->post_parent ){
+    if ( $post->post_parent && !has_post_thumbnail($post->ID)){
         $post_id = $post->post_parent;
     }
-    else
-        $post_id = $post->ID;
 
     if (has_post_thumbnail($post_id) && (!(is_home()) ) && (!(is_single())) && (!(is_archive())) && (!(is_search()))) {
             $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), "full");
index 0be6ec2..ae7dfd6 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -135,8 +135,11 @@ $(document).ready(function () {
    $(document).on('change', '#arriveOff', function () {
         currentDate = $("#arriveOff").val();
         currentDate = new Date(currentDate);
+       
+       // this section is used to circumvent issues with selecting the last day of the month without a proper rollover to the following month.
         currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(),   currentDate.getUTCDate());
         currentDate.setDate(currentDate.getDate());
+       
         dd = currentDate.getDate() + 1;
         if (dd <= 9) {
             dd = '0' + dd;
index f9db19f..0104f7e 100644 (file)
@@ -126,8 +126,11 @@ $(document).ready(function () {
    $(document).on('change', '#arriveOff', function () {
         currentDate = $("#arriveOff").val();
         currentDate = new Date(currentDate);
+       
+       // this section is used to circumvent issues with selecting the last day of the month without a proper rollover to the following month.
         currentDate = new Date(currentDate.getUTCFullYear(), currentDate.getUTCMonth(),   currentDate.getUTCDate());
         currentDate.setDate(currentDate.getDate());
+       
         dd = currentDate.getDate() + 1;
         if (dd <= 9) {
             dd = '0' + dd;
index 932cf6b..1e5c8bd 100644 (file)
@@ -232,20 +232,4 @@ img.alignleft, img.alignright, img.aligncenter, img.alignnone, div.wp-caption im
         text-align: center;
     }
 }
-@media print {
-    #addthis_wrapper, #copyright, #respond, #blog-side-info-wrapper, #footer_address, #action-items, #crumb-line,.no-featured, aside, header, nav, footer{
-        display: none;
-    }
-    #blog-posts-over, #blog-posts-over p{
-        page-break-before: always;
-    }
-    img{
-        page-break-before: always;
-    }
-    h1, h2, h3, h4, h5, h6{
-        page-break-before: always;
-    }
-    
-}
-
 // End Search and Posts