Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter agusparadak

    (@agusparadak)

    It worked!
    Thank you so much.

    Thread Starter agusparadak

    (@agusparadak)

    Thanks for the reply.

    This is how my code looks like now:

    <?php $my_query = new WP_Query('category_name=Noticias&posts_per_page=3');
      	while ($my_query->have_posts()) : $my_query->the_post();
      	$do_not_duplicate[] = $post->ID?>
    
    	<h3 id="post-<?php the_ID(); ?>">
    	<?php the_title(); ?></h3>
    	<?php the_excerpt(); ?>
    
      	<?php endwhile; ?>
    
    	<?php if (have_posts()) : while (have_posts()) : the_post();
     	if (in_array($post->ID, $do_not_duplicate)) continue;?> 
    
    	<h3 id="post-<?php the_ID(); ?>">
    	<?php the_title(); ?></h3>
    	<?php the_excerpt(); ?>
    
      	<?php endwhile; endif; ?>

    Sorry for my ignorance, but I still have the same problem.
    The 3 latest posts are showed, but the last one is the one I don’t want to show, I suppose is the one which is not going to be duplicated, but it still shows.

    The thing is, how can I make reference to the last post and tell it not to show up? Because I’m already showing it above with this code:

    <div id="noticia_info">
    		<h2 id="post-<?php the_ID(); ?>">
            <?php the_title(); ?></h2>
    		<p><a href="<?php the_permalink() ?>">Ver art&iacute;culo</a></p>
    	</div>

    I don’t know if I’m making myself understood, my English isn’t that good 🙁

Viewing 2 replies - 1 through 2 (of 2 total)