I have created Custom slideshow post type.Images set as featured images for each new slide post. I want to retrieve these image in slideshow template.
HTML markup for this slide template is:
<div class="wrapper">
<ul id="my-slider" class="my-slider">
<li>
<a href="http://www.flickr.com/photos/photo/123456" target="_blank"><img src="images/1.jpg" alt="image1"/></a>
<div class="my-description">
<h3>Image one</h3>
</div>
</li>
<li>
<a href="http://www.flickr.com/photos/photo/1234565" target="_blank"><img src="images/2.jpg" alt="image2"/></a>
<div class="my-description">
<h3>Image two</h3>
</div>
</li>
<li>
<a href="http://www.flickr.com/photos/photo/12345655" target="_blank"><img src="images/3.jpg" alt="image3"/></a>
<div class="my-description">
<h3>Image three</h3>
</div>
</li>
<li>
<a href="http://www.flickr.com/photos/photo/12345666" target="_blank"><img src="images/4.jpg" alt="image4"/></a>
<div class="my-description">
<h3>Image four oner</h3>
</div>
</li>
</ul>
</div>
This HTML gives four slide images as I hard-coded it.How to retrieve attached image dynamically from wordpress custom post type to get the same result?
Why not simply query for your custom post type? An example:
I have implemented this by getting array of all images from custom post type and storing it in variable $myimage.
$myimage[0] is the src for img tag which need to catch in loop to get all images