fixing the blocks output limit
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 7 Sep 2018 15:40:16 +0000 (11:40 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 7 Sep 2018 15:40:16 +0000 (11:40 -0400)
functions.php
parts/blog-feed-front.php

index 5852588..711d0ab 100644 (file)
@@ -212,18 +212,20 @@ function content_excerpt($post_id, $length = 35){
     if( $the_post->post_excerpt ){
        $the_excerpt = $the_post->post_excerpt;
     } else {
-        $the_excerpt = apply_filters('the_content', $the_post->post_content);
-    }
+        $the_excerpt = $the_post->post_content;
 
+    }
+    
     $excerpt_length = $length; //Sets excerpt length by word count
     $the_excerpt = strip_tags(strip_shortcodes($the_excerpt)); //Strips tags and images
     $words = explode(' ', $the_excerpt, $excerpt_length + 1);
-
+    
     if(count($words) > $excerpt_length) :
         array_pop($words);
-        array_push($words, '');
+        array_push($words, '');
         $the_excerpt = implode(' ', $words);
     endif;
+
     return $the_excerpt;
 }
 ?>
index 825f48b..cd88570 100644 (file)
@@ -71,7 +71,7 @@
                                     <div class="front-page-post-content-container overlay">
                                         <h2 class="title-posts"><a href="<?php echo $block->url; ?>"><?php echo $block->post_title; ?></a></h2>
                                         <div class="glm-block-content">
-                                            <?php content_excerpt($block->ID) . $block->post_excerpt;?>
+                                            <?php echo content_excerpt($block->ID, 20) . $block->post_excerpt;?>
                                             <?php if($block->url) { ?>
                                                 <a class="glm-block-readmore" href="<?php echo $block->url;?>">...More content at this link</a>
                                             <?php } ?>