You just need one more else
statement, that’s it.
<?php
$lifestyle_cat = array(
'category_name' => 'lifestyle',
'showposts' => 3,
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC'
);
$lifestyle_query = new WP_Query( $lifestyle_cat );
if ( $lifestyle_query->have_posts()) {
$i = 0;
while ( $lifestyle_query->have_posts()) {
$i++;
$lifestyle_query->the_post();
if ($i==1) { // these are added and not within the 3 show posts
?> <p> <?php the_title();?> i = 1</p> <?php
} elseif ($i==2) { // these are added and not within the 3 show posts
?> <p> <?php the_title();?> i = 2</p> <?php
} else { ?>
<p><?php the_title(); ?></p>
<?php } ?>
<?php } } else {
// no posts found
}
wp_reset_postdata(); ?>