I would like to create custom post query where i will list all my posts in the list. Then the tricky bit is to add different content to sixth element off that list.
So something like this
<li>custom post 1</li>
<li>custom post 2</li>
<li>custom post 3</li>
<li>custom post 4</li>
<li>custom post 5</li>
<li><the_content></li>
<li>custom post 6</li>
<li>custom post 7</li>
ok here is what it did:
<ul>
<?php $my_query = new WP_Query( array(
'post_type' => 'people',
'posts_per_page' => 10,
'order' => 'DESC',
'paged'=> $paged
) );?>
<?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<?php if ( $my_query->current_post == 5 ) { ?>
<li>I'm odd one</li>
<?php } else {?>
<li><?php the_title(); ?></li>
<?php } ?>
<?php endwhile; ?>
<?php wp_reset_query();?>
</ul>
I hope that make sense,
Thank you very much.