From c1eb4ed19b7f12cc49e1cc72806866545b2c3c64 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 30 Aug 2016 16:14:00 -0400 Subject: [PATCH] adding elipses to the end of the 'excerpts' for the community map dropdown page content --- parts/community-map.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/parts/community-map.php b/parts/community-map.php index ea506e3..3e9f72c 100644 --- a/parts/community-map.php +++ b/parts/community-map.php @@ -10,10 +10,10 @@ - - post_content),0, 300) ; ?> + + post_content),0, 300) . "..."; ?> - +

MORE
@@ -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']; - }); }); -- 2.17.1