Multiple loops, same posts…
-
I installed Featured Content Slider v2.4 on my site:
https://embeddedcomputingsystems.com/2/?page_id=5
I am pulling content from my WordPress install… my issue is that while my stories are loading in the first portion, I also need then image thumbnails to load in the the pagination portion…
I have tried to use multiple “loops” to grab the post’s image, title, and link in the first loop. I can’t seem to get the second loop to work to pull my “thumb” custom field.
<div id="slider1" class="sliderwrapper"> <?php query_posts('showposts=3'); // First loop, we only get the most recent post if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="contentdiv"> <a href="<?php the_permalink(); ?>"><img src="<?php $key="image"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php the_title(); ?>" border="0" style="border: 3px solid #333333; filter:alpha(opacity=60); opacity:0.6;"/></a> <div class="topstorysm"> <h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4> <?php the_excerpt(); ?> <span class="comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span> </div> </div> <?php endwhile; endif; ?> </div> <div id="paginate-slider1" class="pagination"> <?php query_posts('showposts=3'); // Second loop if (have_posts()) : while (have_posts()) : the_post(); ?> <a href="<?php the_permalink(); ?>" class="toc"><img src="<?php $key="thumb"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php the_title(); ?>" border="0" /></a> <?php endwhile; endif; ?> </div> <script type="text/javascript"> featuredcontentslider.init({ id: "slider1", //id of main slider DIV contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"] toc: ["markup"], //Valid values: "#increment", "markup", ["label1", "label2", etc] nextprev: ["<img src='prev.gif' />", "<img src='next.gif' />"], //labels for "prev" and "next" links. Set to "" to hide. revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover" enablefade: [true, 0.2], //[true/false, fadedegree] autorotate: [true, 6000], //[true/false, pausetime] onChange: function(previndex, curindex){ //event handler fired whenever script changes slide //previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc) //curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc) } }) </script>
Any help is greatly appreciated! Thanks!
Jon
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Multiple loops, same posts…’ is closed to new replies.