Display first, second, and third posts as list item
-
Heya. I’m trying to make a slider that pulls in the image uploaded to a meta box on its post. I’ve tried different combinations of get_post, query_post, offset=x arg etc. based on other forum answers and don’t know what I’m doing wrong.
When using this code:
<?php query_posts('category_name=featured&posts_per_page=3'); ?> <div id="blueberryslider"> <?php while (have_posts()) : the_post(); ?> <div class="blueberry clear center"> <ul class="slides"> <li><a href="<?php the_field('slider_url') ?>" title="<?php the_field( 'slider_video_tagline' ); ?>" rel="prettyPhoto"><img src="<?php the_field( 'slider_image' ); ?>" alt="<?php the_field( 'slider_video_title' ); ?>" width="900"></a></li>
it shows 3 of the latest posts in one
<li>
, but I can’t figure how to get it to show one post per<li>
, which is what I need.Here’s what the html has to be for the slider to work:
<div id="blueberryslider"> <div class="blueberry clear center"> <ul class="slides"> <li><a href="<?php the_field('slider_url') ?>" title="<?php the_field( 'slider_video_tagline' ); ?>" rel="prettyPhoto"><img src="<?php the_field( 'slider_image' ); ?>" alt="<?php the_field( 'slider_video_title' ); ?>" width="900"></a></li> <li><a href="<?php the_field('slider_url') ?>" title="<?php the_field( 'slider_video_tagline' ); ?>" rel="prettyPhoto"><img src="<?php the_field( 'slider_image' ); ?>" alt="<?php the_field( 'slider_video_title' ); ?>" width="900"></a></li> <li><a href="<?php the_field('slider_url') ?>" title="<?php the_field( 'slider_video_tagline' ); ?>" rel="prettyPhoto"><img src="<?php the_field( 'slider_image' ); ?>" alt="<?php the_field( 'slider_video_title' ); ?>" width="900"></a></li> </ul> </div>
Where/how do I call the posts into each
<li>
? Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Display first, second, and third posts as list item’ is closed to new replies.