【发布时间】:2014-06-19 16:48:50
【问题描述】:
我正在为 wordpress 使用Classipress theme,我正在尝试将我的精选广告粘贴在类别中。
我找到了返回此错误的代码:
Warning: in_array() expects parameter 2 to be array, string given in loop-ad_listing.php on line 26
要使用置顶代码,我必须编辑两个页面并插入两个代码,然后我将发布错误部分:
第一:loop-ad_listing.php
代码1:
global $postisfeatured;
global $featurePostArray;
if ($postisfeatured == "1")
array_push($featurePostArray, $post->ID);
if (in_array($post, "ID", $featurePostArray) && $postisfeatured != "1")
echo '<div class="hide">';
代码2:
if ($postisfeatured != "1") {
appthemes_after_endwhile();
$postisfeatured = "";
}
那条线:if (in_array($post,"ID",$featurePostArray) && $postisfeatured != "1") {
是错误。
【问题讨论】: