Help from PHP/CSS/Java Experts - Wordpress Excerpt too short

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!

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(']]>', ']]&gt;', $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.
 
Have you tried changing the '45' in the previous function?
 
Tried it, made no difference. :bang:

This is why I gave up computers as a career path, far too infuriating!
 
Last edited by a moderator:
Lensa, one that appears to be half finished and has no proper documentation or developer follow up. It is at least free. I've already had to make several code adjustments just to get it to display properly in non Firefox browsers.
 
Back
Top