• Hi,

    To begin with I started using the loop function to create a list of thumbnails but when I clicked on a thumbnail/link and got to the post page it only showed the thumbnail for the post. Therefore I’m using the get_posts.

    So, I’ve made a list of thumbnails which are linked to their post. The list only needs to show 6 thumbnails at the time. The thing is that I need at “Next” and “Previous” button – just like using the loop.

    My question is: Is it possible to make a “Next/Previous” function by using get_posts, or how can I make a list by using the loop function without having the problem when entering a post page?

    My get_posts code:

    <?php
    	$lastposts = get_posts('numberposts=6');
    	 foreach($lastposts as $post) :
    	setup_postdata($post);
    ?>
    
    <?php $thumbnail = get_post_meta($post->ID, 'thumbnail', $single = true); ?>  
    
    <?php if($thumbnail !== '') { ?>
    
    	<div class="item fl">
    	<a href="<?php the_permalink() ?>">
    	<img src="<?php echo $thumbnail;?>" alt="<?php the_title(); ?>" border="0" class="pic_thumb"/></a>
    
    <?php } ?>
    </div>
    <?php endforeach; ?>

    I’m a sorta new to WordPress, so please, help me out here? :o)

Viewing 3 replies - 16 through 18 (of 18 total)
  • I think I have a solution now, but I think it will be easier if I integrated it into your code rather than trying to write out instructions. If you will email me your php file, I will put in the changes and send it back.

    Thread Starter tuplet

    (@tuplet)

    I’ve send you a mail :o)

    Sorry, I haven’t got anything yet. Please resend to m_a_mcdonald =at= bellsouth =dot= net.

Viewing 3 replies - 16 through 18 (of 18 total)

The topic ‘Get next 6 thumbnails – get_posts or loop?’ is closed to new replies.