commit c492029df7721f3d42a6b3243b1de5f4cd65f170
parent c92473350ae455d3a55d51aba34f184f178f1497
Author: Overseer <1836442+robertdherb@users.noreply.github.com>
Date: Sat, 24 Feb 2018 22:44:06 -0600
ACTUALLY make post snippets
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/functions.php b/functions.php
@@ -83,17 +83,16 @@ function get_posts() {
function get_post_snippet( $post ) {
$content = file_get_contents( "posts/" . $post );
-
if( strlen( $content ) > 500 ) {
- $shortText = substr($content, 0, strpos( $content, '.', 500) ); // Short text to first period after 500 characters
+ $shortText = substr($content, 0, strpos( $content, ".", 500) + 1 ); // Short text to first period after 500 characters
}
else {
- $shorText = $content;
+ $shortText = $content;
}
$parsedown = new Parsedown();
- return strip_tags( $parsedown->text( $content ) );
+ return strip_tags( $parsedown->text( $shortText ) );
}