adding elipses to the end of the 'excerpts' for the community map dropdown page content
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 30 Aug 2016 20:14:00 +0000 (16:14 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 30 Aug 2016 20:14:00 +0000 (16:14 -0400)
parts/community-map.php

index ea506e3..3e9f72c 100644 (file)
               <!-- default page id = 155 -->
             <?php $community_page_object  = get_page( 155 ); ?>
             <?php $community_page_image  = wp_get_attachment_url( get_post_thumbnail_id( 155 )); ?>
-            <?php $community_page_url     = get_permalink(155); ?>
-            <?php $community_page_content = substr(strip_tags($community_page_object->post_content),0, 300) ; ?>
+            <?php $community_page_url     = get_permalink( 155 ); ?>
+            <?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 echo get_the_excerpt( 155 ); ?>
                 <a class="map-page-link" href="<?php echo $community_page_url ;?>"><div class="map-image-container"></div></a>
                 <div class="map-page-title-container"><a class="map-page-link map-title-link" href="<?php echo $community_page_url ;?>"><h4 class="map-page-title"></h4></a></div>
                 <div class="map-page-content">MORE</div>
@@ -59,6 +59,14 @@ foreach ($nav_posts as $p){
     $sites[$p->ID]['url'] = get_permalink($p->ID);
     $sites[$p->ID]['title'] = get_the_title($p->ID);
     $sites[$p->ID]['image'] = wp_get_attachment_url( get_post_thumbnail_id($p->ID));
+
+    // $content = strip_tags($page_object->post_content);
+    // $filter_content = mb_substr($content, 0, strpos($content, ' ', 260));
+    // $filter_content = json_encode(strip_shortcodes($filter_content));
+    // $filter_content = trim(preg_replace('/\s+/', ' ',$filter_content);
+
+
+
     $filter_content = substr(strip_tags($page_object->post_content),0, 300);
     $filter_content = strip_shortcodes($filter_content);
     $sites[$p->ID]['content'] = $filter_content;
@@ -135,7 +143,6 @@ foreach ($nav_posts as $p){
 
         $(region).on("click", function (){
             window.location.href = site_array[id]['url'];
-
         });
     });