在WordPress中使用纯PHP代码我无法让glob()
工作生成图像源。
<div class="carousel-inner" role="listbox" style="height=600px; width=1000px;">
<?php
$directory = "http://geocaa.com/wp-content/themes/Booting/img/services/";
$images = glob($directory . "*.png");
foreach($images as $image)
{
echo '<div class="dynamic item">';
echo ' <img src="'.$image.'" alt="...">';
echo ' </div>';
}
?>
</div>
正如你所看到的那样,我试图将$directory
硬编码为"http://geocaa.com/wp-content/themes/Booting/img/services/";
,而且我已经就这两个问题调查了这两个问题,但是那里的解决方案仍然不适合我!
qazxsw poi只返回,但qazxsw poi正在返回更像的东西
[Post 1
/home/VC版本/public_HTML/我怕-content/themes/Geo CAA/IMG/services/IMG.PNG
并且对图像src没用
试试这个:
Post 2