close

轉自 http://wordpress.org/support/topic/plugin-yoast-breadcrumbs-warning-array_slice

PHP出現 WARNING: array_slice() expects parameter 1 to be array 的問題

解法是在array_slice()之前先去跑is_array()的判斷,把不是array的情況過濾掉

--

websnail
Member
Posted 2 years ago #

Not sure where you're getting sociable.php from phorbidden but this fixed the issue for me:

Open: yoast-posts.php

Find:
$items = array_slice($rss->items, 0, 2)

Replace with:
$items = is_array($rss->items) ? array_slice($rss->items, 0, 2) : '';

That, at least stops the code erroring out..

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 dizzy03 的頭像
    dizzy03

    碎碎念

    dizzy03 發表在 痞客邦 留言(0) 人氣()