Improvements

This commit is contained in:
Danang Probo Sayekti 2015-07-14 19:36:27 +07:00
commit c7bf485275
4 changed files with 10 additions and 4 deletions

View file

@ -909,7 +909,7 @@ function get_teaser($text)
{ {
$teaserType = config('teaser.type'); $teaserType = config('teaser.type');
if (strlen(strip_tags($text)) < config('teaser.char') || $teaserType === 'full') { if ($teaserType === 'full') {
echo $text; echo $text;
} else { } else {
$string = preg_replace('/\s\s+/', ' ', strip_tags($text)); $string = preg_replace('/\s\s+/', ' ', strip_tags($text));

View file

@ -36,7 +36,9 @@
<?php } ?> <?php } ?>
<div class="teaser-body" itemprop="articleBody"> <div class="teaser-body" itemprop="articleBody">
<?php echo get_thumbnail($p->body) ?> <?php echo get_thumbnail($p->body) ?>
<p><?php echo get_teaser($p->body) ?>... <a href="<?php echo $p->url;?>#more">more</a></p> <p><?php echo get_teaser($p->body) ?>
<?php if (config('teaser.type') === 'trimmed'):?> ... <a href="<?php echo $p->url;?>#more">more</a><?php endif;?>
</p>
</div> </div>
</div> </div>
</div> </div>

View file

@ -36,7 +36,9 @@
<?php } ?> <?php } ?>
<div class="teaser-body" itemprop="articleBody"> <div class="teaser-body" itemprop="articleBody">
<?php echo get_thumbnail($p->body) ?> <?php echo get_thumbnail($p->body) ?>
<p><?php echo get_teaser($p->body) ?>... <a href="<?php echo $p->url;?>#more">more</a></p> <p><?php echo get_teaser($p->body) ?>
<?php if (config('teaser.type') === 'trimmed'):?> ... <a href="<?php echo $p->url;?>#more">more</a><?php endif;?>
</p>
</div> </div>
</div> </div>
</div> </div>

View file

@ -36,7 +36,9 @@
<?php } ?> <?php } ?>
<div class="teaser-body" itemprop="articleBody"> <div class="teaser-body" itemprop="articleBody">
<?php echo get_thumbnail($p->body) ?> <?php echo get_thumbnail($p->body) ?>
<p><?php echo get_teaser($p->body) ?>... <a href="<?php echo $p->url;?>#more">more</a></p> <p><?php echo get_teaser($p->body) ?>
<?php if (config('teaser.type') === 'trimmed'):?> ... <a href="<?php echo $p->url;?>#more">more</a><?php endif;?>
</p>
</div> </div>
</div> </div>
</div> </div>