doubu1964 2015-10-08 14:21
浏览 26

Rocco主题功能错误内爆

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!

  • 写回答

1条回答 默认 最新

  • duannian4784 2015-10-08 14:28
    关注

    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?

    评论

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大