Hi all, I would really appreciate help with this, I have been trying to get it to work for weeks. What I am trying to do, is display the 3 latest posts near the top of my page in single posts. What I am using is this code:
<?php $posts = get_posts( "numberposts=3" ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <div class="wide3"> <p><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p> <a href="<?php the_permalink() ?>" class="product"> <?php echo c2c_get_custom('pic'); ?> <span><?php echo c2c_get_custom('price'); ?></span> </a> </div> <?php endforeach; ?> <?php endif; ?>
This code works great, and displays my 3 latest posts properly, however in the main portion of the page, where the current post is suppose to be displayed, it displays the most recent posts rather than the one for this particular single page. I guess what I need is a way for it to call the single post again since its stuck thinking about most recent posts. Thanks for any help!
- The topic ‘Display 3 Recent Posts in Single.php’ is closed to new replies.