removing top padding from excerpt text

This commit is contained in:
Amine Ben hammou
2018-05-24 07:44:41 +00:00
parent 5b077cfb54
commit 2215b53141
2 changed files with 8 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ class PostContentManager {
}
}
function filterContent($content) {
function filterContent($content, $with_post_class = true) {
$content = self::convertEmbeddedContent($content);
// convert h4 h5 h6 to h3
@@ -49,7 +49,9 @@ class PostContentManager {
'<h2>', '<h3>', '<a>', '<ul>', '<ol>', '<li>', '<br>', '<blockquote>'
);
$content = strip_tags($content, implode('', $tags_not_being_stripped));
$content = str_replace('<p', '<p class="' . self::WP_POST_CLASS .'"', wpautop($content));
if($with_post_class) {
$content = str_replace('<p', '<p class="' . self::WP_POST_CLASS .'"', wpautop($content));
}
$content = trim($content);
return $content;