adding featured image capability for main nav pages only, added excerpt support for...
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 4 Oct 2016 17:17:17 +0000 (13:17 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 4 Oct 2016 17:17:17 +0000 (13:17 -0400)
functions.php
parts/dropdown-map.php

index deb01b4..5e25ff7 100644 (file)
@@ -58,6 +58,7 @@ if (!function_exists('glm_get_clientinfo_option')) {
 add_theme_support('custom-fieldss');
 add_theme_support('post-thumbnails');
 set_post_thumbnail_size(120, 100, true);
+add_post_type_support("page", 'excerpt');
 /**
  * glm_site_scripts
  *
@@ -85,8 +86,7 @@ function glm_site_scripts()
 /* Header for posts*/
 function glm_get_header() {
     echo '<div';
-
-    if (has_post_thumbnail()) {
+    if ( has_post_thumbnail() && is_page( array( 180,182,184,186,187,179 ) ) ) {
             $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
             echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 350px; "';
     } else {
index 550cf55..f4ab5bd 100644 (file)
@@ -36,8 +36,9 @@
                     <?php $community_page_object  = get_page( 254 ); ?>
                     <?php $community_page_image  = wp_get_attachment_image_src( get_post_thumbnail_id( 254 ), 'map-image'); ?>
                     <?php $community_page_url     = get_permalink( 254 ); ?>
-                    <?php $community_page_content = substr(strip_tags($community_page_object->post_content),0, 300) . "..."; ?>
-                    <?php $community_page_content = json_encode(strip_shortcodes($community_page_content)); ?>
+                    <?php //$community_page_content = substr(strip_tags($community_page_object->post_content),0, 300) . "..."; ?>
+                    <?php //$community_page_content = json_encode(strip_shortcodes($community_page_content)); ?>
+                    <?php $community_page_content = json_encode( get_the_excerpt( 254 ) ); ?>
                     
                     
                     <div class="map-page-title-container"><a class="map-page-link map-title-link" href="<?php echo $community_page_url ;?>"></a></div>
@@ -109,7 +110,6 @@ foreach ($nav_posts as $p){
 
         // set the default data next to the dropdown community map
         function set_default_data(){
-            
             regionData.find(page_title).html('<?php echo $community_page_object->post_title; ?>');
             regionData.find(image_container).css("height","125px").css("width", "125px").css("background", "url('   <?php echo $community_page_image[0]; ?>  ')no-repeat center center").css("background-size", "cover");
             regionData.find(page_content).html(default_content);
@@ -140,7 +140,7 @@ foreach ($nav_posts as $p){
                 image_container.css("display", "none");
             }
 
-            regionData.find(page_content).html(site_array[id]['content'] + "...");
+            regionData.find(page_content).html(site_array[id]['excerpt'] + "...");
             regionData.find(more_link).attr("href", site_array[id]['url']);
 
         }, function () {
@@ -149,14 +149,12 @@ foreach ($nav_posts as $p){
 
         $(region).on("click", function (){
             window.location.href = site_array[id]['url'];
-            console.log("test");
         });
         
         $(".map-text").on("click", function(){
             id = $(this).attr("data-id");
             window.location.href = site_array[id]['url'];
         });
-        
     });
 
 </script>
\ No newline at end of file