From 29388690b98e6829df615c02168d3537b1f0cdcd Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 7 Sep 2018 11:40:16 -0400 Subject: [PATCH] fixing the blocks output limit --- functions.php | 10 ++++++---- parts/blog-feed-front.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index 5852588..711d0ab 100644 --- a/functions.php +++ b/functions.php @@ -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; } ?> diff --git a/parts/blog-feed-front.php b/parts/blog-feed-front.php index 825f48b..cd88570 100644 --- a/parts/blog-feed-front.php +++ b/parts/blog-feed-front.php @@ -71,7 +71,7 @@

post_title; ?>

- ID) . $block->post_excerpt;?> + ID, 20) . $block->post_excerpt;?> url) { ?> ...More content at this link -- 2.17.1