I get this error on my website:
Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/content/77/12366977/html/wp-content/themes/rocco/functions.php on line 86
Warning: implode() [function.implode]: Invalid arguments passed in /home/content/77/12366977/html/wp-content/themes/rocco/functions.php on line 86
I think the line that the error is occuring is this one: * Excerpt * --------------------------------------------------------------------------- */ function mfn_excerpt($post, $length = 55, $tags_to_keep = '', $extra = ' [...]') {
if(is_int($post)) {
$post = get_post($post);
} elseif(!is_object($post)) {
return false;
}
if(has_excerpt($post->ID)) {
$the_excerpt = $post->post_excerpt;
return apply_filters('the_content', $the_excerpt);
} else {
$the_excerpt = $post->post_content;
}
$the_excerpt = strip_shortcodes(strip_tags($the_excerpt, $tags_to_keep));
$the_excerpt = preg_split('/\b/', $the_excerpt, $length * 2+1);
$excerpt_waste = array_pop($the_excerpt);
$the_excerpt = implode($the_excerpt);
if( $excerpt_waste ) $the_excerpt .= $extra;
return apply_filters('the_content', $the_excerpt);
What should I do and where should I add the code, if adding code is the solution? Thanks so much for your help!
First of all PHP implode takes two arguments if the explode is not standard and proably this is the case. You are using only one
Also there is no "array_map" in your example. Is really the same code?