Normally if you set a custom excerpt it shows the full text of that excerpt. In this case the length is being limited by the PHP function mb_substr
to a limit of 180 characters or whatever the shop_dec_len
option is set to. This tells me that you can either modify that parameter of mb_substr
directly or there is an option somewhere in the admin and you don't even need to change the code. To modify it directly you could do the following:
<?php if ($post->post_excerpt && $post->post_excerpt != "") echo '<div itemprop="description" class="desc">' . mb_substr ( strip_tags($post->post_excerpt), 0, 100 ) . $len . '</div>'; ?>
For a different way to trim the excerpt, you might look into [trim_word()][2]
which is a neat function someone wrote for trimming without breaking words:
/**
* trims text to a space then adds ellipses if desired
* @param string $input text to trim
* @param int $length in characters to trim to
* @param bool $ellipses if ellipses (...) are to be added
* @param bool $strip_html if html tags are to be stripped
* @return string
*/
function trim_text($input, $length, $ellipses = true, $strip_html = true) {
//strip tags, if desired
if ($strip_html) {
$input = strip_tags($input);
}
//no need to trim, already shorter than trim length
if (strlen($input) <= $length) {
return $input;
}
//find last space within length
$last_space = strrpos(substr($input, 0, $length), ' ');
$trimmed_text = substr($input, 0, $last_space);
//add ellipses (...)
if ($ellipses) {
$trimmed_text .= '...';
}
return $trimmed_text;
}
So that might look like:
<?php if ($post->post_excerpt && $post->post_excerpt != "") echo '<div itemprop="description" class="desc">' . trim_words( $post->post_excerpt, 100, false, true ) . $len . '</div>'; ?>