Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何加载或链接到wordpress post图像_Wordpress_Image_Slideshow - Fatal编程技术网

如何加载或链接到wordpress post图像

如何加载或链接到wordpress post图像,wordpress,image,slideshow,Wordpress,Image,Slideshow,我有一个滑块显示通过点击它在更大的尺寸后画廊格式的图像 我有下面的代码 我在这个url中输入了数据srchttp://wpthemetestdata.files.wordpress.com/2012/12/unicorn-wallpaper.jpg 当点击任何图像直接加载这个图像,但我想当把一个wordpress函数放在数据src中,直到点击任何图像直接显示或加载这个图像 <ul id="lightGallery" class="gallery"> <?php foreach

我有一个滑块显示通过点击它在更大的尺寸后画廊格式的图像 我有下面的代码 我在这个url中输入了数据srchttp://wpthemetestdata.files.wordpress.com/2012/12/unicorn-wallpaper.jpg 当点击任何图像直接加载这个图像,但我想当把一个wordpress函数放在数据src中,直到点击任何图像直接显示或加载这个图像

<ul id="lightGallery" class="gallery">

<?php foreach ($post_images as $post_image) : ?>

<li class="col-lg-4" data-title="" data-desc="" data-responsive-src="" data-  src="http://wpthemetestdata.files.wordpress.com/2012/12/unicorn-wallpaper.jpg"> 
    <a href="<?php the_permalink(); ?>">
       <?php echo wp_get_attachment_image( $post_image->ID, array() ); ?>
    </a> 
</li>

我使用下面的函数解决了我的问题

echo wp_get_attachment_url($post_image->ID);