• Hello,

    I am working on a new blog: http://embeddedcomputingsystems.com/

    The “Latest Story” should be the most recent post. Then the “Latest News” should show the x most recent posts, minus the most recent already showing under “Latest Story.” The problem is I am getting a duplication of the most recent post. Here is the code I’m using:

    Latest Story:

    <?php query_posts('showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <a href="<?php the_permalink(); ?>"><img src="<?php $key="image"; echo get_post_meta($post->ID, $key, true); ?>" border="0" /></a>
    <h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
    <?php the_excerpt(); ?>
    <?php endwhile; ?>

    Latest News:

    <?php $my_query = new WP_Query('showposts=6');
    if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
    <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
    <?php the_excerpt(); ?>
    <?php endwhile; endif; ?>

    I have used this same code on another site and it appears to work! Why am I getting duplicates still?

    Thanks for the help,

    Jon

The topic ‘Post is Duplicating’ is closed to new replies.