有关在WordPress中使用PHP glob()的问题

问题描述 投票:0回答:1

在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没用

php wordpress wordpress-theming
1个回答
1
投票

试试这个:

Post 2
© www.soinside.com 2019 - 2024. All rights reserved.