AJQS
Suspended / Banned
- Messages
- 7,314
- Name
- Alan
- Edit My Images
- No
Trying to extend the limit of the excerpts on my blog page as at the minute it's not even covering two lines!
That's the code as it stands. Now you'd think that altering $limit=35 to a larger number would do it, but it doesn't. If I decrease it it shortens the excerpt but I can't extend it! Any ideas, the above code is beyond my skill level.
PHP:
/*-----------------------------------------------------------------------------------*/
/* Excerpt
/*-----------------------------------------------------------------------------------*/
//Add excerpt on pages
if(function_exists('add_post_type_support'))
add_post_type_support('page', 'excerpt');
/** Excerpt character limit */
/* Excerpt length */
function colabs_excerpt_length($length) {
if( get_option('colabs_excerpt_length') != '' ){
return get_option('colabs_excerpt_length');
}else{
return 45;
}
}
add_filter('excerpt_length', 'colabs_excerpt_length');
//Custom Excerpt Function
function colabs_custom_excerpt($limit,$more) {
global $post;
if ($limit=='')$limit=35;
$print_excerpt = '<p>';
$output = $post->post_excerpt;
if ($output!=''){
$print_excerpt .= $output;
}else{
$content = get_the_content('');
$content = strip_shortcodes( $content );
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
$content = strip_tags($content);
$excerpt = explode(' ',$content, $limit);
array_pop($excerpt);
$print_excerpt .= implode(" ",$excerpt).$more;
}
$print_excerpt .= '</p>';
echo $print_excerpt;
}
That's the code as it stands. Now you'd think that altering $limit=35 to a larger number would do it, but it doesn't. If I decrease it it shortens the excerpt but I can't extend it! Any ideas, the above code is beyond my skill level.