我正在尝试在本地安装主题,但是当我这样做时,出现以下错误:
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\wp-content\themes\royalestate\slider.php on line 4
Call Stack
# Time Memory Function Location
1 0.0005 369184 {main}( ) ..\index.php:0
2 0.0007 372840 require( 'C:\wamp\www\wp-blog-header.php' ) ..\index.php:17
3 1.3620 21193256 require_once( 'C:\wamp\www\wp-includes\template-loader.php' ) ..\wp-blog-header.php:16
4 1.3635 21212432 include( 'C:\wamp\www\wp-content\themes\royalestate\homepage.php' ) ..\template-loader.php:47
5 1.4038 21296984 include( 'C:\wamp\www\wp-content\themes\royalestate\slider.php' ) ..\homepage.php:12
如果我的问题出在滑块代码上,那么它在下面,但我认为不应该有,因为我是开箱即用的。
<div id="slider-container">
<div class="flexslider">
<ul class="slides">
<?php $slider_ctr = 0; foreach($slides as $num => $slide) : if ($slider_ctr < 5) : $image_aq = aq_resize($slide['src'], 100, 73, true);
?><li data-thumb="<?php echo aq_resize($slide['src'], 100, 73, true) ?>">
<a href="<?php echo $slide['link'] ?>"><img alt="" src="<?php echo aq_resize($slide['src'], 676, 290, true) ?>"/></a>
<div class="flex-caption">
<p><?php echo $slide['title'] ?></p>
<p><strong><?php echo $slide['caption'] ?></strong></p>
</div>
</li><?php
$slider_ctr++; endif; endforeach; ?>
</ul>
</div>
</div>
您的帮助将不胜感激。干杯,破布