Specific div layout using wp_query
The last few days I’ve been struggling to get the following output by using WP_query (outside the Loop):
<div id="slider"> <img src="http://urlof.the/image/goes/here.jpg" title="slide1"/> <img src="http://urlof.other/image/goes/here.jpg" title="slide2"/> </div> <div id="slide1" class="nivo-qhtml-caption"> <p><span>Caption title Slide1</span></p> <p>Caption contents slide 1</p> </div> <div id="slide2" class="nivo-qhtml-caption"> <p><span>Caption title Slide2</span></p> <p>Caption contents Slide2</p> </div>
The reason I want my output this way, is to use a nivo slider on my website. All the attributes get their values from variables coming from a custom post type. To add a slide, you can just use the custom post type and add a new post.
Through this post type a user would enter the url of the slide image, an id used for the slide (used for the title of the image and the div id for the caption that goes along with the image). A user can also has a box to fill in the caption title and a box to use for teh caption. Only thing I need now is to get my ouput sorted in teh above way.
I allready tried different ‘while’ loops, but with no result. Any ideas anyone?
Thanks in advance!
- The topic ‘Specific div layout using wp_query’ is closed to new replies.