[EventCalendar] conflict with excerpt code

Stace Felder stacef at pacbell.net
Mon Mar 23 01:29:48 UTC 2009


Hey there,

Just installed and activated Event Calendar (and Event Calendar  
Widget) 3.1.4 under WP 2.7.1 and I like what I see!  One thing I just  
discovered, however, is that it conflicts with some custom excerpt  
code I use.  That is, this function no longer works:

//code to change [...] to a Read More link and only when there really  
is more to read
function my_custom_excerpt($text) { // Fakes an excerpt if needed
         if ( '' == $text ) {
                 $text = get_the_content('');
                 $text = apply_filters('the_content', $text);
                 $text = str_replace(']]>', ']]>', $text);
                 $text = strip_tags($text, '<p> <a> <strong>');	//to  
allow style and html, after $text add: , '<p> <a>'
			if (in_category('Thoughts') && is_home) { $excerpt_length = 100;}
			elseif (in_category('feature') && is_home) { $excerpt_length = 55;}
			elseif (in_category('Library' || 'Library Reviews'))  
{ $excerpt_length = 65;}
			else { $excerpt_length = 50;}

                 $words = explode(' ', $text, $excerpt_length + 1);
                 if (count($words) > $excerpt_length) {
                         array_pop($words);
                         array_push($words, '...<a href="'.  
get_permalink() . '"> Read More' . ' &raquo; </a>');
                         $text = implode(' ', $words);
                 }
         }
         return $text;
}

Any ideas what's colliding here?

Thanks,
Stace





More information about the EventCalendar mailing list