Display 3 posts with different HTML markup in Wordpress using a loop

severn

New Member
I want to be able to display 3 posts from the same category on my index.php page, but due to the way my site's HTML/CSS is coded I'm having some difficulty understanding the correct way to go about doing this using a loop (as the code for the divs being used are not the same for all three sections, it's using different CSS styles to achieve a layered effect/look ).Here is the HTML code.\[code\]<div id="first-story" class="story"><div class="content"><h3 class="story-heading">Headline 1</h3> <ul> <li>Nullam sit amet scelerisque est. </li> <li>Aliquam erat volutpat. Duis sed nisi nunc, faucibus rutrum mauris. </li> <li>Nullam iaculis lorem ut tortor ullamco per aliquet. Integer id leo non mauris pulvinar gravida vitae a enim. </li> <li>Nullam sit amet scelerisque est.</li> </ul> <a class="learnmore" href="http://stackoverflow.com/questions/14593598/#"><img src="http://stackoverflow.com/questions/14593598/img/button-learnmore.png"></a></div> <div class="edge"></div></div><div id="second-story" class="story"> <div class="content"> <h3 class="story-heading">Headline 2</h3> <p>Paragraph text</p> <a class="learnmore" href="http://stackoverflow.com/questions/14593598/#"><img src="http://stackoverflow.com/questions/14593598/img/button-learnmore.png"></a></div> </div></div><div id="third-story" class="story"> <div class="edge"></div> <div class="content">Headline 3</div> <ul> <li>List item</li> </ul> <a class="learnmore" href="http://stackoverflow.com/questions/14593598/#"><img src="http://stackoverflow.com/questions/14593598/img/button-learnmore.png"></a></div></div>\[/code\]Any help would be very much appreciated.
 
Back
Top